✨ Disable the webhook server by setting the port to -1 - #3481
✨ Disable the webhook server by setting the port to -1#3481kubernetes-prow[bot] merged 2 commits into
Conversation
Signed-off-by: Troy Connor <troy0820@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: troy0820 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Would we rather set it to something different and leave -1 the default port? Disabling the webhooks should be an option if the user wants to disable. |
|
Sorry for the delay. I'll take a look soon |
| // Port is the port number that the server will serve. | ||
| // It will be defaulted to 9443 if unspecified. | ||
| // | ||
| // To disable the webhook server set Port to -1. |
There was a problem hiding this comment.
Given that 0 is the zero value and we previously used the DefaultPort in that case I guess -1 is our only option.
Unfortunately it's inconsistent with the metrics server (that uses 0 for disabled), but I don't have a better idea
@alvaroaleman is that fine for you as well or do you see an alternative?
There was a problem hiding this comment.
I am unaware of this history of why we would default to 9443 if the user set anything < 0, which to me seems like the user wants to not serve on 9443 if they are going through the trouble of setting it. The 0 value I agree if they don't set it should be 9443, but anything less than that it seems the user is intentionally trying to set it to serve on a port that wouldn't work.
06784a0 to
c50cfb1
Compare
Signed-off-by: Troy Connor <troy0820@users.noreply.github.com>
c50cfb1 to
558486c
Compare
|
Thank you! /lgtm |
|
LGTM label has been added. DetailsGit tree hash: cf58c270ccdb47bfec55babbf3d77fa136c6d0d5 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, troy0820 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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 andallows the port to be set to -1 to signal the disabling of the webhook server./assign @sbueringer