mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
kubeadm: delete boostrap-kubelet.conf after TLS bootstrap on init
This commit is contained in:
parent
2dedfddf81
commit
71cb27836d
@ -19,6 +19,7 @@ package phases
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"text/template"
|
||||
"time"
|
||||
@ -100,6 +101,13 @@ func runWaitControlPlanePhase(c workflow.RunData) error {
|
||||
return errors.New("couldn't initialize a Kubernetes cluster")
|
||||
}
|
||||
|
||||
// Deletes the kubelet boostrap kubeconfig file, so the credential used for TLS bootstrap is removed from disk
|
||||
// This is done only on success.
|
||||
bootstrapKubeConfigFile := kubeadmconstants.GetBootstrapKubeletKubeConfigPath()
|
||||
if err := os.Remove(bootstrapKubeConfigFile); err != nil {
|
||||
klog.Warningf("[wait-control-plane] could not delete the file %q: %v", bootstrapKubeConfigFile, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user