diff --git a/cmd/kubeadm/app/cmd/reset.go b/cmd/kubeadm/app/cmd/reset.go index 23f2bf62a1c..66a64e2cdf8 100644 --- a/cmd/kubeadm/app/cmd/reset.go +++ b/cmd/kubeadm/app/cmd/reset.go @@ -167,7 +167,7 @@ func newResetData(cmd *cobra.Command, opts *resetOptions, in io.Reader, out io.W certificatesDir = opts.externalcfg.CertificatesDir } else if len(resetCfg.CertificatesDir) > 0 { // configured in the ResetConfiguration certificatesDir = resetCfg.CertificatesDir - } else if len(initCfg.ClusterConfiguration.CertificatesDir) > 0 { // fetch from cluster + } else if initCfg != nil && len(initCfg.ClusterConfiguration.CertificatesDir) > 0 { // fetch from cluster certificatesDir = initCfg.ClusterConfiguration.CertificatesDir }