feat: node-collector custom namespace support (#4407)

Signed-off-by: chenk <hen.keinan@gmail.com>
This commit is contained in:
chenk
2023-05-16 13:41:01 +03:00
committed by GitHub
parent 864ad10a38
commit 1a56295ff8
5 changed files with 105 additions and 93 deletions

View File

@@ -22,7 +22,7 @@ func clusterRun(ctx context.Context, opts flag.Options, cluster k8s.Cluster) err
var artifacts []*artifacts.Artifact
var err error
if opts.Scanners.AnyEnabled(types.MisconfigScanner) && slices.Contains(opts.Components, "infra") {
artifacts, err = trivyk8s.New(cluster, log.Logger).ListArtifactAndNodeInfo(ctx, opts.Tolerations...)
artifacts, err = trivyk8s.New(cluster, log.Logger).ListArtifactAndNodeInfo(ctx, opts.NodeCollectorNamespace, opts.Tolerations...)
if err != nil {
return xerrors.Errorf("get k8s artifacts with node info error: %w", err)
}