-
Notifications
You must be signed in to change notification settings - Fork 431
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
✨ Allow customizing generated webhook K8s Service #1128
Conversation
Hi @davidxia. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
tested manually by
case 1: backwards compatibility
case 2: modify marker only for MutatingWebhookConfiguration
|
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.
Overall lgtm so far
/ok-to-test |
Allow customizing the webhook K8s Service's name, namespace, and port. ## example usage Look for the new `serviceName`, `serviceNamespace`, and `servicePort` fields. ``` ❯ GOBIN=(pwd)/bin go install ./cmd/* ❯ ./bin/controller-gen webhook -w Webhook +kubebuilder:webhook:admissionReviewVersions=<[]string>,failurePolicy=<string>,groups=<[]string>[,matchPolicy=<string>],mutating=<bool>,name=<string>[,path=<string>][,reinvocationPolicy=<string>],resources=<[]string>[,serviceName=<string>][,serviceNamespace=<string>][,servicePort=<int>][,sideEffects=<string>][,timeoutSeconds=<int>][,url=<string>],verbs=<[]string>,versions=<[]string>[,webhookVersions=<[]string>] package specifies how a webhook should be served. ... ``` contributes to kubernetes-sigs#865 Signed-off-by: David Xia <[email protected]>
Thanks for the initial review. Wrote an integration test. Ready for another review. |
Thank you! /lgtm |
LGTM label has been added. Git tree hash: babb9bdd65bafd28d6a0a9743b709b706d2bcc68
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: davidxia, sbueringer 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 |
thank you! |
You're welcome :) Thx for the PR(s)! |
v1 = "v1" | ||
defaultWebhookVersion = v1 | ||
defaultServiceName = "webhook-service" | ||
defaultServiceNamespace = "system" |
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 looks like this change may have broken the default behavior 😞
Is this the intended outcome? Or is it an unexpected side effect of the change?
cc/ @sbueringer
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 see how this change could affect the name of your CRD?
CustomResourceDefinition.apiextensions.k8s.io "project-v4-system" is invalid: metadata.name: Invalid value: "project-v4-system": must be spec.names.plural+"."+spec.group
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.
At most this will affect the content of *WebhookConfiguration objects
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.
This change is meant to be backwards-compat.
I also see
error when retrieving current configuration of:
Resource: "admissionregistration.k8s.io/v1, Resource=mutatingwebhookconfigurations", GroupVersionKind: "admissionregistration.k8s.io/v1, Kind=MutatingWebhookConfiguration"
Name: "project-v4-mutating-webhook-configuration/project-v4-serving-cert", Namespace: ""
from server for: "STDIN": invalid resource name "project-v4-mutating-webhook-configuration/project-v4-serving-cert": [may not contain '/']
Is this another error separate from must be spec.names.plural+
?
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.
You can close this one, @davidxia, as it's sorted out. I figured out what was wrong—it was my bad. Everything is working as before. Sorry for the unnecessary disturbance!
Allow customizing the webhook K8s Service's name, namespace, and port.
example usage
Look for the new
serviceName
,serviceNamespace
, andservicePort
fields.contributes to #865