-
Notifications
You must be signed in to change notification settings - Fork 420
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
Extend webhook marker documentation #353
Conversation
Welcome @anyasabo! |
/assign @droot |
@@ -70,9 +70,15 @@ type Config struct { | |||
// Versions specifies the API versions that this webhook receives requests for. | |||
Versions []string | |||
|
|||
// Name indicates the name of this webhook configuration. | |||
// Name indicates the name of this webhook configuration. Should be a domain with at least three segments separated by dots |
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.
Should be a domain with at least three segments separated by dots
Probably just say:
Name should be fully qualified, e.g. imagepolicy.kubebuilder.io
.
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.
An FQDN can also simply be kubebuilder.io
, so this is more specific about the requirements I think. This is simply using the wording direct from the webhook validation. This is the error you receive if you try to apply a webhook with a name with < 3 labels:
The ValidatingWebhookConfiguration "validating-webhook-configuration" is invalid: webhooks[0].name: Invalid value: "funfunfun": should be a domain with at least three segments separated by dots
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: anyasabo, mengqiy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Extends the marker documentation for webhook generation for
name
andpath
.The OpenAPI specs for webhooks require the name is a domain name.
The path is handled specially by controller-runtime, so this adds documentation on how controller-runtime handles it here:
https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/builder/webhook.go#L158
Otherwise the webhook configuration generated by controller-tools will not match what actually runs with controller-runtime