Skip to content

Commit

Permalink
🐛 Do not exit if annotations not defined in scan/vuln cmd.
Browse files Browse the repository at this point in the history
  • Loading branch information
preslavgerchev committed Oct 16, 2023
1 parent 181d628 commit ad74632
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions apps/cnspec/cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,7 @@ 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, _ := cmd.Flags().GetStringToString("annotation")
// merge the config and the user-provided annotations with the latter having precedence
optAnnotations := opts.Annotations
if optAnnotations == nil {
Expand Down

0 comments on commit ad74632

Please sign in to comment.