Skip to content

Commit

Permalink
allow to shutdown quickly the apiserver
Browse files Browse the repository at this point in the history
  • Loading branch information
aojea committed Jun 27, 2024
1 parent 418f98a commit 7c4726d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/controlplane/controller/kubernetesservice/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,15 @@ func (c *Controller) Stop() {
// Run periodically updates the kubernetes service
func (c *Controller) Run(ch <-chan struct{}) {
// wait until process is ready
wait.PollImmediateUntil(100*time.Millisecond, func() (bool, error) {
ctx := wait.ContextForChannel(ch)
err := wait.PollUntilContextCancel(ctx, 100*time.Millisecond, true, func(context.Context) (bool, error) {
var code int
c.client.CoreV1().RESTClient().Get().AbsPath("/readyz").Do(context.TODO()).StatusCode(&code)
return code == http.StatusOK, nil
}, ch)
})
if err != nil {
return
}

wait.NonSlidingUntil(func() {
// Service definition is not reconciled after first
Expand Down

0 comments on commit 7c4726d

Please sign in to comment.