Skip to content

Commit

Permalink
feat: change flag name from skip-intrusive to non-intrusive
Browse files Browse the repository at this point in the history
Signed-off-by: chenk <[email protected]>
  • Loading branch information
chen-keinan committed Apr 2, 2024
1 parent ca30ae6 commit df2f599
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions pkg/flag/kubernetes_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ var (
Shorthand: "A",
Usage: "fetch resources from all cluster namespaces",
}
SkipIntrusive = Flag[bool]{
Name: "skip-intrusive",
NonIntrusive = Flag[bool]{
Name: "non-intrusive",
ConfigName: "kubernetes.non.intrusive",
Usage: "When the flag is activated, the node-collector job will not be executed, thus skipping misconfiguration findings on the node.",
}
Expand Down Expand Up @@ -92,7 +92,7 @@ type K8sFlagGroup struct {
KubeConfig *Flag[string]
K8sVersion *Flag[string]
Tolerations *Flag[[]string]
SkipIntrusive *Flag[bool]
NonIntrusive *Flag[bool]
NodeCollectorImageRef *Flag[string]
AllNamespaces *Flag[bool]
NodeCollectorNamespace *Flag[string]
Expand All @@ -112,7 +112,7 @@ type K8sOptions struct {
AllNamespaces bool
NodeCollectorNamespace string
ExcludeOwned bool
SkipIntrusive bool
NonIntrusive bool
ExcludeNodes map[string]string
QPS float32
Burst int
Expand All @@ -125,7 +125,7 @@ func NewK8sFlagGroup() *K8sFlagGroup {
KubeConfig: KubeConfigFlag.Clone(),
K8sVersion: K8sVersionFlag.Clone(),
Tolerations: TolerationsFlag.Clone(),
SkipIntrusive: SkipIntrusive.Clone(),
NonIntrusive: NonIntrusive.Clone(),
AllNamespaces: AllNamespaces.Clone(),
NodeCollectorNamespace: NodeCollectorNamespace.Clone(),
ExcludeOwned: ExcludeOwned.Clone(),
Expand All @@ -146,7 +146,7 @@ func (f *K8sFlagGroup) Flags() []Flagger {
f.Namespace,
f.KubeConfig,
f.K8sVersion,
f.SkipIntrusive,
f.NonIntrusive,
f.Tolerations,
f.AllNamespaces,
f.NodeCollectorNamespace,
Expand Down Expand Up @@ -184,7 +184,7 @@ func (f *K8sFlagGroup) ToOptions() (K8sOptions, error) {
KubeConfig: f.KubeConfig.Value(),
K8sVersion: f.K8sVersion.Value(),
Tolerations: tolerations,
SkipIntrusive: f.SkipIntrusive.Value(),
NonIntrusive: f.NonIntrusive.Value(),
AllNamespaces: f.AllNamespaces.Value(),
NodeCollectorNamespace: f.NodeCollectorNamespace.Value(),
ExcludeOwned: f.ExcludeOwned.Value(),
Expand Down
2 changes: 1 addition & 1 deletion pkg/k8s/commands/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func clusterRun(ctx context.Context, opts flag.Options, cluster k8s.Cluster) err
return xerrors.Errorf("get k8s artifacts with node info error: %w", err)
}
case types.FormatJSON, types.FormatTable:
if opts.Scanners.AnyEnabled(types.MisconfigScanner) && !opts.SkipIntrusive {
if opts.Scanners.AnyEnabled(types.MisconfigScanner) && !opts.NonIntrusive {
artifacts, err = trivyk8s.New(cluster, log.Logger, trivyk8s.WithExcludeOwned(opts.ExcludeOwned)).ListArtifactAndNodeInfo(ctx,
trivyk8s.WithScanJobNamespace(opts.NodeCollectorNamespace),
trivyk8s.WithIgnoreLabels(opts.ExcludeNodes),
Expand Down

0 comments on commit df2f599

Please sign in to comment.