From 7dc1cff58e39d13c6250a5e0d3eb825f367be29b Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Mon, 16 Oct 2023 09:07:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20add=20comment=20why=20we=20need?= =?UTF-8?q?=20no=20error=20check=20for=20annotations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/cnspec/cmd/scan.go | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/cnspec/cmd/scan.go b/apps/cnspec/cmd/scan.go index 61df30d9..026cb480 100644 --- a/apps/cnspec/cmd/scan.go +++ b/apps/cnspec/cmd/scan.go @@ -215,6 +215,7 @@ func getCobraScanConfig(cmd *cobra.Command, runtime *providers.Runtime, cliRes * log.Fatal().Err(err).Msg("failed to parse inventory") } + // annotations are user-added, editable labels for assets and are optional, therefore we do not need to check for err annotations, _ := cmd.Flags().GetStringToString("annotation") // merge the config and the user-provided annotations with the latter having precedence optAnnotations := opts.Annotations