Skip to content

Commit bd770bd

Browse files
committed
refactor: improve operator readiness check logic and configurations
- Change log level from Debug to Info for operator readiness - Increase the wait loop iteration count from 10 to 60 seconds before checking operator readiness - Modify sleep durations during the readiness check Signed-off-by: ysicing <[email protected]>
1 parent c3abaf1 commit bd770bd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/quickon/quickon.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,18 +471,18 @@ func (m *Meta) QuickONReady() {
471471

472472
// OperatorReady OperatorReady
473473
func (m *Meta) OperatorReady() error {
474-
m.Log.Debug("waiting for operator ready")
475-
for i := 1; i <= 10; i++ {
474+
m.Log.Info("waiting for operator ready")
475+
for i := 1; i <= 60; i++ {
476476
deploy, err := m.kubeClient.GetDeployment(context.Background(), common.GetDefaultSystemNamespace(true), common.DefaultCneOperatorName, metav1.GetOptions{})
477477
if err != nil {
478-
time.Sleep(time.Duration(i) * 2 * time.Second)
478+
time.Sleep(4 * time.Second)
479479
continue
480480
}
481481
ready := deploy.Status.ReadyReplicas == *deploy.Spec.Replicas
482482
if ready {
483483
return nil
484484
}
485-
time.Sleep(time.Duration(i) * 2 * time.Second)
485+
time.Sleep(2 * time.Second)
486486
}
487487
return errors.Errorf("operator not ready")
488488
}

0 commit comments

Comments
 (0)