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

ConstraintTemplate spec.crd.names should following CustomResourceDefinitionNames spec #67

Open
josh-ferrell-sas opened this issue Jan 13, 2020 · 3 comments

Comments

@josh-ferrell-sas
Copy link
Contributor

The OPA Constraint Framework should follow the Kubernetes CustomResourceDefinitionNames spec for Constraint templates to allow specifying plural, singular, shortnames, etc.. without modifying the CRD after the constraint template is created.

https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#customresourcedefinitionnames-v1-apiextensions-k8s-io

@maxsmythe
Copy link
Contributor

Hi!

The ability to have multiple names for a resource was causing problems by making it possible for people to create constraint templates that were in conflict with each other:

open-policy-agent/gatekeeper#156

In the end, we thought it'd be good to make sure only one name can be specified, making it impossible for a user to to thing that create two CRDs with conflicting names or somehow inject the wrong Rego code.

Is there a use case you're looking to support?

@josh-ferrell-sas
Copy link
Contributor Author

I can strip out the ability to specify singular and plural name specs but my goal started with being able to specify shortnames so I could get 'ir' instead of 'ingressrestriction'.

@maxsmythe
Copy link
Contributor

+1 on adding short names.

Lets drop plural and singular. We could also add configurable categories in here (so long as "all" and "constraints" are specified by default per: https://github.com/open-policy-agent/frameworks/pull/65/files

Though the category thing could be saved for later, if preferable.

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

No branches or pull requests

2 participants