Skip to content

Add --ignore-kinds flag to exclude resource kinds from results#605

Open
Kunalbehbud wants to merge 1 commit into
FairwindsOps:masterfrom
Kunalbehbud:feat/ignore-kinds-flag
Open

Add --ignore-kinds flag to exclude resource kinds from results#605
Kunalbehbud wants to merge 1 commit into
FairwindsOps:masterfrom
Kunalbehbud:feat/ignore-kinds-flag

Conversation

@Kunalbehbud

Copy link
Copy Markdown

Fixes #399

Adds an --ignore-kinds flag that excludes specific resource kinds from the results, as discussed in the issue:

I think adding that flag could be useful as well

It mirrors the existing --components filter semantics: a StringSlice flag threaded into the API instance, applied in FilterOutput against the kind of the matched deprecated apiVersion. The match is case-sensitive (CronJob, Ingress, ...). Since flags are bound automatically, PLUTO_IGNORE_KINDS works as well and is documented alongside the flag in docs/advanced.md.

Scope note: this deliberately doesn't touch the custom-versions-file discussion from the second comment on the issue — that's a separate concern.

Testing

Added a table-driven TestFilterOutput covering: no ignored kinds (unchanged behavior), one kind excluded, all kinds excluded.

go test ./pkg/api/ -run TestFilterOutput

Adds a StringSlice flag that filters matched deprecations by the kind
of the deprecated apiVersion, mirroring the existing --components
filter semantics. Includes FilterOutput unit tests and docs.

Fixes FairwindsOps#399
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exclude some resource kind

1 participant