From b0814869b0a2ba2be0973c472e7e4ecb1630386d Mon Sep 17 00:00:00 2001 From: Matthew L Daniel Date: Mon, 15 Apr 2019 22:06:27 -0700 Subject: [PATCH] Output missing cert or key name in DownloadCerts Otherwise the user does not know what key `kubeadm` is expecting, which makes troubleshooting harder --- cmd/kubeadm/app/phases/copycerts/copycerts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/kubeadm/app/phases/copycerts/copycerts.go b/cmd/kubeadm/app/phases/copycerts/copycerts.go index 438a152dae..f67b7b3a28 100644 --- a/cmd/kubeadm/app/phases/copycerts/copycerts.go +++ b/cmd/kubeadm/app/phases/copycerts/copycerts.go @@ -231,7 +231,7 @@ func DownloadCerts(client clientset.Interface, cfg *kubeadmapi.InitConfiguration for certOrKeyName, certOrKeyPath := range certsToTransfer(cfg) { certOrKeyData, found := secretData[certOrKeyNameToSecretName(certOrKeyName)] if !found { - return errors.New("couldn't find required certificate or key in Secret") + return errors.Errorf("the Secret does not include the required certificate or key - name: %s, path: %s", certOrKeyName, certOrKeyPath) } if len(certOrKeyData) == 0 { klog.V(1).Infof("[download-certs] Not saving %q to disk, since it is empty in the %q Secret\n", certOrKeyName, kubeadmconstants.KubeadmCertsSecret)