Skip to content

Commit 4c1003a

Browse files
committed
remove extra registry pod when it is created
Signed-off-by: akihikokuroda <[email protected]>
1 parent 39cbdcd commit 4c1003a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/controller/registry/reconciler/configmap.go

+5
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@ func (c *ConfigMapRegistryReconciler) currentPodsWithCorrectResourceVersion(sour
234234
}
235235
if len(pods) > 1 {
236236
logrus.WithField("selector", source.Labels()).Debug("multiple pods found for selector")
237+
for i := 1; i < len(pods); i++ {
238+
if err := c.OpClient.KubernetesInterface().CoreV1().Pods(source.GetNamespace()).Delete(context.TODO(), pods[i].GetName(), *metav1.NewDeleteOptions(0)); err != nil && !k8serrors.IsNotFound(err) {
239+
logrus.Debugf("error deleting extra pod: %s", pods[i].GetName())
240+
}
241+
}
237242
}
238243
return pods
239244
}

0 commit comments

Comments
 (0)