Skip to content

Commit 34f9532

Browse files
committed
Change default leader election id, fixes #368
1 parent 4c2d5ef commit 34f9532

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

pkg/controller/node/node_controller.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
129129
// also the pod should not be initialized before and should be running because the init
130130
// timeout is ~5s (see above) and the cluster status can become obsolete
131131
UpdateFunc: func(evt event.UpdateEvent) bool {
132-
log.Info("update event", "pod", evt.ObjectNew)
133132
return isOwnedByMySQL(evt.MetaNew) && isRunning(evt.ObjectNew) && !isReady(evt.ObjectNew)
134133
},
135134

pkg/controller/node/node_ctrl_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ var _ = Describe("MysqlNode controller", func() {
129129
By("create MySQL pod")
130130
pod := getOrCreatePod(c, cluster, 0)
131131
setPodPhase(c, pod, corev1.PodRunning)
132+
// no event for create
133+
// pod update as running
132134
Eventually(requests).Should(Receive(Equal(expectedRequest(0))))
135+
// pod update for pod conditions (NodeInitializedConditionType)
133136
Eventually(requests).Should(Receive(Equal(expectedRequest(0))))
134137
})
135138

@@ -161,10 +164,12 @@ var _ = Describe("MysqlNode controller", func() {
161164
pod1 := getOrCreatePod(c, cluster, 0)
162165

163166
// when pod is ready should not be triggered a reconcile event
167+
By("update pod status to Pending")
164168
setPodPhase(c, pod1, corev1.PodPending)
165169
Consistently(requests).ShouldNot(Receive(Equal(expectedRequest(0))))
166170

167171
// mark pod running, should init node
172+
By("update pod status to Running")
168173
setPodPhase(c, pod1, corev1.PodRunning)
169174
Eventually(requests).Should(Receive(Equal(expectedRequest(0))))
170175

pkg/options/options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const (
102102
defaultOrchestratorTopologyPassword = ""
103103

104104
defaultLeaderElectionNamespace = "default"
105-
defaultLeaderElectionID = ""
105+
defaultLeaderElectionID = "mysql-operator-leader-election"
106106

107107
defaultNamespace = ""
108108
)

0 commit comments

Comments
 (0)