Skip to content

✨ Disable the webhook server by setting the port to -1#3481

Open
troy0820 wants to merge 2 commits intokubernetes-sigs:mainfrom
troy0820:troy0820/disable-webhook
Open

✨ Disable the webhook server by setting the port to -1#3481
troy0820 wants to merge 2 commits intokubernetes-sigs:mainfrom
troy0820:troy0820/disable-webhook

Conversation

@troy0820
Copy link
Copy Markdown
Member

Resolves #3456

Currently there is no way to disable the webhook server. If we don't set the option, we get one automatically. If we set the port to -1 it would set it to the default port.

This change adds a DisabledServer that Satisfies the webhook.Server interface and allows the port to be set to -1 to signal the disabling of the webhook server. The controller manager will now allow the server to be nil and not panic in order to allow the change to work.

/assign @sbueringer

Signed-off-by: Troy Connor <troy0820@users.noreply.github.com>
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 17, 2026
Signed-off-by: Troy Connor <troy0820@users.noreply.github.com>
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: troy0820
Once this PR has been reviewed and has the lgtm label, please ask for approval from sbueringer. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide an easy way to turn off the webhook server

3 participants