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

Add an option for enable/disable webhook for a standard operator generated by kubebuilder #102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dashanji
Copy link
Contributor

@dashanji dashanji commented Apr 3, 2023

As titled. Fix #57.

@dashanji
Copy link
Contributor Author

dashanji commented Apr 3, 2023

@arttor Hi, could you please take a look at this? Thanks.

@arttor
Copy link
Owner

arttor commented Apr 13, 2023

Hi @dashanji, I am very sorry. Will only have time to check on the weekend.

volumeMounts := ` - mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true`
webhookPort := ` - containerPort: 9443
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a better way to handle webhooks? I've tried to search a couple of kubebuilder projects on GitHub and some of them are using different ports or yaml properties can be ordered differently so strings.ReplaceAll will not work in most cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching out, It looks like we could use the regular expression to handle these cases.

Copy link
Contributor Author

@dashanji dashanji Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arttor Does such design make sense to you?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, regular expressions look promising.

@dashanji
Copy link
Contributor Author

Hi @arttor, could you please take a look at this? Thanks.

@dashanji dashanji force-pushed the add-enable-webhook-option branch 2 times, most recently from 7c562c0 to bcac65f Compare July 17, 2023 07:48
…nerated by kubebuilder.

* Use regular expressions to match the containerPort of the webhook.

Signed-off-by: Ye Cao <caoye.cao@alibaba-inc.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 this pull request may close these issues.

Add a flag to disable/enable the webhook while rendering Operator
2 participants