include kube-dns deployment check

ignore 404 error
pull/6/head
Sandeep Rajan 2018-01-03 14:45:17 +05:30
parent 7253c35ceb
commit 9d7b74658d
1 changed files with 7 additions and 2 deletions

View File

@ -21,6 +21,7 @@ import (
"os"
"time"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/errors"
clientset "k8s.io/client-go/kubernetes"
@ -122,9 +123,13 @@ func removeOldKubeDNSDeploymentIfCoreDNSIsUsed(cfg *kubeadmapi.MasterConfigurati
return err
}
if coreDNSDeployment.Status.ReadyReplicas == 0 {
return fmt.Errorf("the CodeDNS deployment isn't ready yet")
return fmt.Errorf("the CoreDNS deployment isn't ready yet")
}
return apiclient.DeleteDeploymentForeground(client, metav1.NamespaceSystem, kubeadmconstants.KubeDNS)
err = apiclient.DeleteDeploymentForeground(client, metav1.NamespaceSystem, kubeadmconstants.KubeDNS)
if err != nil && !apierrors.IsNotFound(err) {
return err
}
return nil
}, 10)
}
return nil