Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
config: Shutdown CVO if configuration controller fails to start
An error in the start logic will now result in the immediate shutdown of the CVO,
rather than in the CVO catching the failed controller and continuing to work
by ignoring the failed start.
  • Loading branch information
DavidHurta committed Sep 24, 2025
commit c5aba512bbfd8b0ed3dd57e6d38c178e3ee4f6b4
24 changes: 15 additions & 9 deletions pkg/cvo/cvo.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@ func (optr *Operator) Run(runContext context.Context, shutdownContext context.Co
defer optr.queue.ShutDown()
defer optr.availableUpdatesQueue.ShutDown()
defer optr.upgradeableQueue.ShutDown()
defer optr.configuration.Queue().ShutDown()
if optr.configuration != nil {
defer optr.configuration.Queue().ShutDown()
}
stopCh := runContext.Done()

klog.Infof("Starting ClusterVersionOperator with minimum reconcile period %s", optr.minimumUpdateCheckInterval)
Expand All @@ -459,6 +461,12 @@ func (optr *Operator) Run(runContext context.Context, shutdownContext context.Co
return fmt.Errorf("caches never synchronized: %w", runContext.Err())
}

if optr.configuration != nil {
if err := optr.configuration.Start(runContext); err != nil {
return fmt.Errorf("unable to initialize the CVO configuration controller: %v", err)
}
}

// trigger the first cluster version reconcile always
optr.queue.Add(optr.queueKey())

Expand Down Expand Up @@ -489,13 +497,9 @@ func (optr *Operator) Run(runContext context.Context, shutdownContext context.Co
resultChannelCount++
go func() {
defer utilruntime.HandleCrash()
if err := optr.configuration.Start(runContext); err != nil {
utilruntime.HandleError(fmt.Errorf("unable to initialize the CVO configuration sync: %v", err))
} else {
wait.UntilWithContext(runContext, func(runContext context.Context) {
optr.worker(runContext, optr.configuration.Queue(), optr.configuration.Sync)
}, time.Second)
}
wait.UntilWithContext(runContext, func(runContext context.Context) {
optr.worker(runContext, optr.configuration.Queue(), optr.configuration.Sync)
}, time.Second)
resultChannel <- asyncResult{name: "cvo configuration"}
}()
} else {
Expand Down Expand Up @@ -571,7 +575,9 @@ func (optr *Operator) Run(runContext context.Context, shutdownContext context.Co
optr.queue.ShutDown()
optr.availableUpdatesQueue.ShutDown()
optr.upgradeableQueue.ShutDown()
optr.configuration.Queue().ShutDown()
if optr.configuration != nil {
optr.configuration.Queue().ShutDown()
}
}
}

Expand Down