diff --git a/apps/cnspec/cmd/scan.go b/apps/cnspec/cmd/scan.go index d16164e6..026cb480 100644 --- a/apps/cnspec/cmd/scan.go +++ b/apps/cnspec/cmd/scan.go @@ -215,11 +215,8 @@ func getCobraScanConfig(cmd *cobra.Command, runtime *providers.Runtime, cliRes * log.Fatal().Err(err).Msg("failed to parse inventory") } - annotations, err := cmd.Flags().GetStringToString("annotation") - if err != nil { - log.Fatal().Err(err).Msg("failed to parse annotations") - } - + // 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 if optAnnotations == nil {