Skip to content

Commit

Permalink
feat: node-collector dynamic commands support
Browse files Browse the repository at this point in the history
Signed-off-by: chenk <[email protected]>
  • Loading branch information
chen-keinan committed Jun 6, 2024
1 parent 125829c commit 9f70462
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/k8s/commands/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ func nodeCollectorOptions(opts flag.Options) []trivyk8s.NodeCollectorOption {
trivyk8s.WithIgnoreLabels(opts.ExcludeNodes),
trivyk8s.WithScanJobImageRef(opts.NodeCollectorImageRef),
trivyk8s.WithTolerations(opts.Tolerations)}

contentPath, err := operation.InitBuiltinPolicies(context.Background(),
opts.CacheDir,
opts.Quiet,
opts.SkipCheckUpdate,
opts.MisconfOptions.ChecksBundleRepository,
opts.RegistryOpts())

if err != nil {
log.Error("Falling back to embedded checks", log.Err(err))
nodeCollectorOptions = append(nodeCollectorOptions,
Expand All @@ -79,6 +81,7 @@ func nodeCollectorOptions(opts flag.Options) []trivyk8s.NodeCollectorOption {
trivyk8s.WithEmbeddedNodeConfigFilesystem(trivy_checks.EmbeddedConfigCommandsFileSystem),
}...)
}

complianceCommandsIDs := getComplianceCommands(opts)
nodeCollectorOptions = append(nodeCollectorOptions, []trivyk8s.NodeCollectorOption{
trivyk8s.WithCommandPaths(contentPath),
Expand Down

0 comments on commit 9f70462

Please sign in to comment.