-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Filter out invalid name information to generate valid hook name #714
base: main
Are you sure you want to change the base?
Filter out invalid name information to generate valid hook name #714
Conversation
With reference to buehler#707 This fixes the behaviour of requeues Co-authored-by: Christoph Bühler <[email protected]>
mutatorConfig.Webhooks.Add(new V1MutatingWebhook | ||
{ | ||
Name = $"mutate.{hook.Metadata.SingularName}.{hook.Metadata.Group}.{hook.Metadata.Version}", | ||
Name = $"mutate.{hookName}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, if no "group" is present, Kubernetes internal stuff defaults to "Core".
Shouldn't we default to "Core" if there is no group present? Either in the metadata class or in this logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a shame to let this fix languish, I got a way into building a validating webhook before finding it doesn't work with pods. Is there a workaround?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. Never had the issue and never got a serious answer 🤷🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addition: If you have a good take on it, or an opinion, feel free to share.
I thought using "default" for the group is a promising idea since it is the default behavior of Kubernetes.
80132ea
to
4283cf6
Compare
Some resources like Service, may not have a group:
So it become some value like this originally:
mutate.service..v1
But the regex for the webhook name in k8s demands this syntax:
Fixes #713