diff --git a/pkg/util/etcdutil/migrate.go b/pkg/util/etcdutil/migrate.go index 7d9ba97d3..4fd60e13d 100644 --- a/pkg/util/etcdutil/migrate.go +++ b/pkg/util/etcdutil/migrate.go @@ -209,7 +209,17 @@ func waitBootEtcdRemoved(etcdServiceIP string) error { } func cleanupBootstrapEtcdService(kubecli kubernetes.Interface) { - if err := kubecli.CoreV1().Services(api.NamespaceSystem).Delete(bootstrapEtcdServiceName, &v1.DeleteOptions{}); err != nil { - glog.Errorf("failed to remove bootstrap-etcd-service: %v", err) + if err := wait.Poll(pollInterval, pollTimeout, func() (bool, error) { + if err := kubecli.CoreV1().Services(api.NamespaceSystem).Delete(bootstrapEtcdServiceName, &v1.DeleteOptions{}); err != nil { + if apierrors.IsNotFound(err) { + glog.Info("bootstrap-etcd-service already removed") + return true, nil + } + glog.Errorf("failed to remove bootstrap-etcd-service: %v", err) + return false, nil + } + return true, nil + }); err != nil { + glog.Errorf("timed out removing bootstrap-etcd-service: %v", err) } }