-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
✨ (:sparkles, minor) Make it possible to monitor readiness for webhook #1124
✨ (:sparkles, minor) Make it possible to monitor readiness for webhook #1124
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: alenkacz The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -76,6 +76,8 @@ type Server struct { | |||
|
|||
// defaultingOnce ensures that the default fields are only ever set once. | |||
defaultingOnce sync.Once | |||
|
|||
Started bool |
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.
Let's document this field, I'm wondering though if we should expose it as a method rather than a field on the struct, given that this field isn't safe to use concurrently
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.
yeah, let's put that behind a method so that it's safe to call concurrently. See also #1155
@@ -226,6 +228,7 @@ func (s *Server) Start(stop <-chan struct{}) error { | |||
close(idleConnsClosed) | |||
}() | |||
|
|||
s.Started = true | |||
err = srv.Serve(listener) | |||
if err != nil && err != http.ErrServerClosed { |
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.
Should this maybe set back to false if the Serve
method returns?
@alenkacz: PR needs rebase. 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/test-infra repository. |
@alenkacz hi, are you still interested in getting this merged? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
/remove-lifecycle rotten |
I'll refresh this |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
@alenkacz I can take over this issue, if it's okay for you. |
Has been implemented in #1588 |
/lgtm cancel |
@sbueringer: Closed this PR. In response to this:
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/test-infra repository. |
This is a very minimal implementation of #723
With this in place, one can define a readiness check for webhook like this:
there's still a possibility for a very small race because technically all the paths for webhook are bound when
srv.Serve
is done. But the possibility of hitting it is very small considering that the readiness check has to pick it up, return ready and someone has to make a request over network to that webhook - that will be definitely slower than the processing insidesrv.Serve
.If anyone has better idea, I am all ears.