Merge pull request #135971 from DEVMANISHOFFL/fix-kubeadm-reset-crash

fix(kubeadm): prevent nil pointer panic in reset command
This commit is contained in:
Kubernetes Prow Robot
2025-12-30 21:56:35 +05:30
committed by GitHub

View File

@@ -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
}