Skip to content

Commit

Permalink
fix: k8s friendly error messages kbom non cluster scans (#5594)
Browse files Browse the repository at this point in the history
Signed-off-by: chenk <hen.keinan@gmail.com>
  • Loading branch information
chen-keinan authored Nov 16, 2023
1 parent 44d0b28 commit 2145464
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/k8s/commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,14 @@ func Run(ctx context.Context, args []string, opts flag.Options) error {
case clusterArtifact:
return clusterRun(ctx, opts, cluster)
case allArtifact:
if opts.Format == types.FormatCycloneDX {
return xerrors.Errorf("KBOM with CycloneDX format is not supported for all namespace scans")
}
return namespaceRun(ctx, opts, cluster)
default: // resourceArtifact
if opts.Format == types.FormatCycloneDX {
return xerrors.Errorf("KBOM with CycloneDX format is not supported for resource scans")
}
return resourceRun(ctx, args, opts, cluster)
}
}
Expand Down

0 comments on commit 2145464

Please sign in to comment.