-
Notifications
You must be signed in to change notification settings - Fork 27
🌱 add webhook flags #316
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
🌱 add webhook flags #316
Conversation
Welcome @defo89! |
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 is certainly useful, thanks for the PR.
I'm not sure how useful this is. If you want to disable webhooks, you'll need to delete the configuration resources from the API server. If you only disable them within the provider the API server won't be able to reach the webhooks and fail every time. |
Sure, whoever is doing this needs to make sure to omit deploying the resources and not to mount the respective secret in Deployment. |
What's the benefit of disabling them in the provider though? Is disabling the webhook configuration not sufficient? |
Yes, both controller config and not deploying webhook resources are needed to disabling webhooks. Not disabling them in the provider leads to manager shutting down due to missing cert:
I have seen same approach in many controller and in capi providers, too. e.g. |
Fine, we can add a way to disable webhooks. Instead of some env variable, would you also be fine with adding the Webhook flags that CAPI has and use fs.IntVar(&webhookPort, "webhook-port", 9443,
"Webhook Server port")
fs.StringVar(&webhookCertDir, "webhook-cert-dir", "/tmp/k8s-webhook-server/serving-certs/",
"Webhook cert dir.")
fs.StringVar(&webhookCertName, "webhook-cert-name", "tls.crt",
"Webhook cert name.")
fs.StringVar(&webhookKeyName, "webhook-key-name", "tls.key",
"Webhook key name.") |
5897662
to
7df4a4a
Compare
Suggested approach sounds good to me. I have updated the PR accordingly. |
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: schrej 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 |
What this PR does / why we need it:
For local development and some cases where webhooks cannot be used, adds an option via env variable to disable them.