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 have no maximum name length #116

Closed
maxsmythe opened this issue May 18, 2021 · 2 comments · Fixed by #248
Closed

ConstraintTemplate have no maximum name length #116

maxsmythe opened this issue May 18, 2021 · 2 comments · Fixed by #248

Comments

@maxsmythe
Copy link
Contributor

Constraint templates do not currently have a maximum name length.

It is necessary to cap the maximum possible constraint template name length to leave room for ConstraintTemplateStatus resources. Constraints have a maximum name length of 63 chars, we can be a bit more generous with Templates, if necessary.

Here is the PR that caps constraint name length, for reference:

b745ff7#diff-f0ceecee7c4c5529a7457604249a3c7e04bf92c547d1b42bf9af2e710cc4ea07

@willbeason
Copy link
Member

Would we do this in the ConstraintTemplate CRD, or programmatically in client.AddTemplate? As-is we'd have to modify the generated YAML ConstraintTemplate CRD output for it to be in the CRD. Programmatically this would be simple to do.

How much do ConstraintTemplateStatus resources need to add to the name? If at most 63 characters, then ConstraintTemplateNames can be up to 253-63=190 characters long.

@maxsmythe
Copy link
Contributor Author

Probably both? Putting it in the CRD would be most reliable for the K8s API server (not reliant on validation webhook being up), but we'd want it in our code for things like gator test

maxsmythe added a commit to maxsmythe/frameworks that referenced this issue Sep 16, 2022
Gatekeeper breaks with longer template names.

Fixes open-policy-agent#116

Signed-off-by: Max Smythe <smythe@google.com>
maxsmythe added a commit to maxsmythe/frameworks that referenced this issue Sep 16, 2022
Gatekeeper breaks with longer template names.

Fixes open-policy-agent#116

Signed-off-by: Max Smythe <smythe@google.com>
maxsmythe added a commit to maxsmythe/frameworks that referenced this issue Sep 16, 2022
This is provided by controller runtime, but we want to double-check
this doesn't regress.

Fixes open-policy-agent#116

Signed-off-by: Max Smythe <smythe@google.com>
maxsmythe added a commit to maxsmythe/frameworks that referenced this issue Sep 16, 2022
This is provided by controller runtime, but we want to double-check
this doesn't regress.

Fixes open-policy-agent#116

Signed-off-by: Max Smythe <smythe@google.com>
maxsmythe added a commit that referenced this issue Sep 29, 2022
This is provided by controller runtime, but we want to double-check
this doesn't regress.

Fixes #116

Signed-off-by: Max Smythe <smythe@google.com>

Signed-off-by: Max Smythe <smythe@google.com>
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.

2 participants