kubeadm: fix join message if kubeadm-certs secret is not present

`kubeadm init phase upload-certs` requires --experimental-upload-certs
argument. Make this explicit in the error if the secret is missing.
pull/564/head
Rafael Fernández López 2019-03-08 22:34:11 +01:00
parent 583ff363fa
commit b57c8e2c45
No known key found for this signature in database
GPG Key ID: 8902294E78418CF9
1 changed files with 1 additions and 1 deletions

View File

@ -252,7 +252,7 @@ func getSecret(client clientset.Interface) (*v1.Secret, error) {
secret, err := client.CoreV1().Secrets(metav1.NamespaceSystem).Get(kubeadmconstants.KubeadmCertsSecret, metav1.GetOptions{})
if err != nil {
if apierrors.IsNotFound(err) {
return nil, errors.Errorf("Secret %q was not found in the %q Namespace. This Secret might have expired. Please, run `kubeadm init phase upload-certs` on a control plane to generate a new one", kubeadmconstants.KubeadmCertsSecret, metav1.NamespaceSystem)
return nil, errors.Errorf("Secret %q was not found in the %q Namespace. This Secret might have expired. Please, run `kubeadm init phase upload-certs --experimental-upload-certs` on a control plane to generate a new one", kubeadmconstants.KubeadmCertsSecret, metav1.NamespaceSystem)
}
return nil, err
}