You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
c.logger.Debugf("The decommissioned node %v should have already triggered master pod migration. Previous k8s-reported state of the node: %v", util.NameFromMeta(nodePrev.ObjectMeta), nodePrev)
c.logger.Debugf("The decommissioned node %v become schedulable again. Current k8s-reported state of the node: %v", util.NameFromMeta(nodeCur.ObjectMeta), nodeCur)
62
+
// do nothing if the node should have already triggered an update or
63
+
// if only one of the label and the unschedulability criteria are met.
unmovablePods[podName] =fmt.Sprintf("could not move master pod %q from node %q: pod belongs to an unknown Postgres cluster %q", podName, nodeName, clusterName)
116
+
c.logger.Warningf("could not move pod %q: pod does not belong to a known cluster", podName)
130
117
continue
131
118
}
132
119
133
120
if!clusters[cl] {
134
121
clusters[cl] =true
135
122
}
136
123
137
-
movableMasterPods[pod] =cl
124
+
masterPods[pod] =cl
138
125
}
139
126
140
127
forcl:=rangeclusters {
141
128
cl.Lock()
142
129
}
143
130
144
-
forpod, cl:=rangemovableMasterPods {
145
-
131
+
forpod, cl:=rangemasterPods {
146
132
podName:=util.NameFromMeta(pod.ObjectMeta)
147
-
iferr:=cl.MigrateMasterPod(podName); err==nil {
148
-
movedMasterPods++
133
+
134
+
iferr:=cl.MigrateMasterPod(podName); err!=nil {
135
+
c.logger.Errorf("could not move master pod %q: %v", podName, err)
149
136
} else {
150
-
unmovablePods[podName] =fmt.Sprintf("could not move master pod %q from node %q: %v", podName, nodeName, err)
137
+
movedPods++
151
138
}
152
139
}
153
140
154
141
forcl:=rangeclusters {
155
142
cl.Unlock()
156
143
}
157
144
158
-
ifleftPods:=len(unmovablePods); leftPods>0 {
159
-
c.logger.Warnf("could not move %d master or unknown role pods from the node %q, you may have to delete them manually",
160
-
leftPods, nodeName)
161
-
for_, reason:=rangeunmovablePods {
162
-
c.logger.Warning(reason)
163
-
}
164
-
}
145
+
totalPods:=len(masterPods)
165
146
166
-
c.logger.Infof("%d master pods have been moved out from the node %q", movedMasterPods, nodeName)
147
+
c.logger.Infof("%d/%d master pods have been moved out from the %q node",
148
+
movedPods, totalPods, nodeName)
167
149
150
+
ifleftPods:=totalPods-movedPods; leftPods>0 {
151
+
c.logger.Warnf("could not move master %d/%d pods from the %q node",
0 commit comments