Severity: Medium
Category
Reliability
Files
cmd/main.go:256-261
Description
The API server runs in a goroutine. If apiServer.Start() fails (port conflict, bind error, etc) it calls os.Exit(1) from that goroutine. This bypasses controller-runtime's shutdown sequence and can leave leader election leases held, blocking other replicas from taking over.
Fix
Signal the manager to shut down gracefully instead of calling os.Exit directly. Use the manager's context cancellation or a shared error channel.
Severity: Medium
Category
Reliability
Files
cmd/main.go:256-261Description
The API server runs in a goroutine. If
apiServer.Start()fails (port conflict, bind error, etc) it callsos.Exit(1)from that goroutine. This bypasses controller-runtime's shutdown sequence and can leave leader election leases held, blocking other replicas from taking over.Fix
Signal the manager to shut down gracefully instead of calling
os.Exitdirectly. Use the manager's context cancellation or a shared error channel.