-
Notifications
You must be signed in to change notification settings - Fork 172
Move webhook setup before manager start #1087
Conversation
/assign @adrianludwin |
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.
lgtm with minor nits. You don't need to test another 20 times after making my suggested changes, once will be fine :)
According to kubernetes-sigs/controller-runtime#1148, there's a race condition between manager start and webhook register. This commit moved webhook setup before manager start. Tested on GKE cluster. The nil pointer error was not detected for 20 times.
3e4a0f2
to
619d6e0
Compare
Updated. BTW tested 20 times because last time it took about 20 times to reproduce the race condition. |
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.
/lgtm
/approve
@rjbez17 this is a fairly straightforward fix, lmk if you have any concerns about it but I'm just approving for now.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adrianludwin, yiqigao217 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest looking the object reconciler issue now. |
This essentially reverts kubernetes-retired#1087, which breaks HNC on new clusters that haven't previously had HNC installed. It fixes the nondeterministic crashing problem by patching in kubernetes-sigs/controller-runtime#1155, which has been applied to controller-runtime 0.6.3 in @adrianludwin's repo. This is a temporary hack and will be removed when controller-runtime releases its own fix - likely 0.6.4. Tested: with the reversion of kubernetes-retired#1087 (main.go), HNC can be installed on a fresh cluster again but fails to start up ~50% of the time. With the fix to controller-runtime, it passes on 20/20 startup attempts. Ran e2e tests and got the same result as without this change (four failures).
This essentially reverts kubernetes-retired#1087, which breaks HNC on new clusters that haven't previously had HNC installed. It fixes the nondeterministic crashing problem by patching in kubernetes-sigs/controller-runtime#1155, which has been applied to controller-runtime 0.6.3 in adrianludwin's repo. This is a temporary hack and will be removed when controller-runtime releases its own fix - likely 0.6.4. Tested: with the reversion of kubernetes-retired#1087 (main.go), HNC can be installed on a fresh cluster again but fails to start up ~50% of the time. With the fix to controller-runtime, it passes on 20/20 startup attempts. Ran e2e tests and got the same result as without this change (four failures).
According to
kubernetes-sigs/controller-runtime#1148,
there's a race condition between manager start and webhook register.
This commit moved webhook setup before manager start.
Tested on GKE cluster. The nil pointer error was not detected for 20
times.