Skip to content

Commit 076a985

Browse files
authored
K8SPS-374: ignore reconcileOrchestrator errors on pause (#999)
https://perconadev.atlassian.net/browse/K8SPS-374
1 parent 42f84db commit 076a985

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pkg/controller/ps/controller.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ func (r *PerconaServerMySQLReconciler) reconcileOrchestrator(ctx context.Context
796796
if err != nil {
797797
return nil
798798
}
799-
g, gCtx := errgroup.WithContext(context.Background())
799+
g, gCtx := errgroup.WithContext(ctx)
800800

801801
if len(raftNodes) > len(existingNodes) {
802802
newPeers := util.Difference(raftNodes, existingNodes)
@@ -808,7 +808,9 @@ func (r *PerconaServerMySQLReconciler) reconcileOrchestrator(ctx context.Context
808808
})
809809
}
810810

811-
log.Error(g.Wait(), "Orchestrator add peers", "peers", newPeers)
811+
if err := g.Wait(); err != nil && !cr.Spec.Pause {
812+
log.Error(err, "Orchestrator add peers", "peers", newPeers)
813+
}
812814
} else {
813815
oldPeers := util.Difference(existingNodes, raftNodes)
814816

@@ -819,7 +821,9 @@ func (r *PerconaServerMySQLReconciler) reconcileOrchestrator(ctx context.Context
819821
})
820822
}
821823

822-
log.Error(g.Wait(), "Orchestrator remove peers", "peers", oldPeers)
824+
if err := g.Wait(); err != nil && !cr.Spec.Pause {
825+
log.Error(err, "Orchestrator remove peers", "peers", oldPeers)
826+
}
823827
}
824828

825829
return nil

0 commit comments

Comments
 (0)