From 52835fbc809eb952aa6f193653482c007fa2b924 Mon Sep 17 00:00:00 2001 From: Yago Nobre Date: Fri, 23 Nov 2018 16:27:00 -0200 Subject: [PATCH] Fix kubeadm reset in case of external etcd --- cmd/kubeadm/app/cmd/reset.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/kubeadm/app/cmd/reset.go b/cmd/kubeadm/app/cmd/reset.go index 26599c8c385e2..4f2261f54c33a 100644 --- a/cmd/kubeadm/app/cmd/reset.go +++ b/cmd/kubeadm/app/cmd/reset.go @@ -207,7 +207,7 @@ func getEtcdDataDir(manifestPath string, client clientset.Interface) (string, er if client != nil { cfg, err := configutil.FetchConfigFromFileOrCluster(client, os.Stdout, "reset", "", false) - if err == nil { + if err == nil && cfg.Etcd.Local != nil { return cfg.Etcd.Local.DataDir, nil } klog.Warningf("[reset] Unable to fetch the kubeadm-config ConfigMap, using etcd pod spec as fallback: %v", err)