Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: support skipping version #169

Open
levenleven opened this issue Jan 24, 2023 · 3 comments · May be fixed by #176
Open

Suggestion: support skipping version #169

levenleven opened this issue Jan 24, 2023 · 3 comments · May be fixed by #176

Comments

@levenleven
Copy link
Contributor

levenleven commented Jan 24, 2023

Currently -skip allows providing a kind or version/kind

if _, ok := val.opts.SkipKinds[signature.GroupVersionKind()]; ok {
return ok
}
_, ok := val.opts.SkipKinds[signature.Kind]
return ok

In some cases it would be handy to be able to skip all resources from the api version altogether e.g.

-skip networking.istio.io/v1alpha3

instead of skipping kinds one by one like

-skip networking.istio.io/v1alpha3/DestinationRule,networking.istio.io/v1alpha3/VirtualService

Would you accept PR introducing such functionality?

@yannh
Copy link
Owner

yannh commented Jan 24, 2023

Hi, could you maybe provide a diff to the "Usage" documentation to explain how you would see this being used first? Thanks!

@levenleven levenleven changed the title Suggestion: support skipping namespace Suggestion: support skipping version Jan 25, 2023
@levenleven
Copy link
Contributor Author

👋 Thanks for looking into this, I've updated the description hopefully it makes sense now. So basically the suggestion is to allow skipping the apiVersion.

Before:

-skip string
      comma-separated list of kinds or GVKs to ignore

After:

-skip string
      comma-separated list of kinds, api versions or GVKs to ignore

@wrdls
Copy link

wrdls commented Feb 8, 2023

Would like to see support for this as well.

My use case is with Gatekeeper.

This allows you to create OPA policies by first creating a templates.gatekeeper.sh/v1/ConstraintTemplate resource which contains a OpenAPIV3Schema schema and then one or more constraints.gatekeeper.sh/v1beta1/<MY_CUSTOM_CONSTRAINT> resources based on that template.

See https://open-policy-agent.github.io/gatekeeper/website/docs/howto#constraint-templates

I would like to ignore all constraints.gatekeeper.sh/v1beta1 because it's pretty much impossible to keep our schemas up to date with those constraint resources (or the list for -skip).

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 a pull request may close this issue.

3 participants