Skip to content

Commit

Permalink
fix: Exit when the operator fails to start up
Browse files Browse the repository at this point in the history
We forgot to add an exit call to the `operator. Start()` call's error path. This leads to strange bugs then the operator cannot access the API server due to a transient problem, the operator fails to register itself as a Gateway API controller so it will not get the watch events it should handle, but instead of exiting it's just sitting there doing nothing. This change makes sure the operator restarts when the API server is unreachable.
  • Loading branch information
rg0now authored Sep 4, 2024
1 parent d73c038 commit 41a0adb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ func main() {
setupLog.Info("starting operator thread")
if err := op.Start(opCtx, mgrCancel); err != nil {
setupLog.Error(err, "problem running operator")
os.Exit(1)
}

setupLog.Info("starting Kubernetes controller manager")
Expand Down

0 comments on commit 41a0adb

Please sign in to comment.