mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
kubeadm-cleanup-unused-func
This commit is contained in:
parent
61fa0fd44a
commit
d94c5bac47
@ -59,21 +59,6 @@ type kubeConfigSpec struct {
|
|||||||
ClientCertAuth *clientCertAuth
|
ClientCertAuth *clientCertAuth
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateInitKubeConfigFiles will create and write to disk all kubeconfig files necessary in the kubeadm init phase
|
|
||||||
// to establish the control plane, including also the admin kubeconfig file.
|
|
||||||
// If kubeconfig files already exists, they are used only if evaluated equal; otherwise an error is returned.
|
|
||||||
func CreateInitKubeConfigFiles(outDir string, cfg *kubeadmapi.InitConfiguration) error {
|
|
||||||
klog.V(1).Infoln("creating all kubeconfig files")
|
|
||||||
return createKubeConfigFiles(
|
|
||||||
outDir,
|
|
||||||
cfg,
|
|
||||||
kubeadmconstants.AdminKubeConfigFileName,
|
|
||||||
kubeadmconstants.KubeletKubeConfigFileName,
|
|
||||||
kubeadmconstants.ControllerManagerKubeConfigFileName,
|
|
||||||
kubeadmconstants.SchedulerKubeConfigFileName,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// CreateJoinControlPlaneKubeConfigFiles will create and write to disk the kubeconfig files required by kubeadm
|
// CreateJoinControlPlaneKubeConfigFiles will create and write to disk the kubeconfig files required by kubeadm
|
||||||
// join --control-plane workflow, plus the admin kubeconfig file used by the administrator and kubeadm itself; the
|
// join --control-plane workflow, plus the admin kubeconfig file used by the administrator and kubeadm itself; the
|
||||||
// kubelet.conf file must not be created because it will be created and signed by the kubelet TLS bootstrap process.
|
// kubelet.conf file must not be created because it will be created and signed by the kubelet TLS bootstrap process.
|
||||||
|
@ -289,16 +289,6 @@ func TestCreateKubeconfigFilesAndWrappers(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expectedError: true,
|
expectedError: true,
|
||||||
},
|
},
|
||||||
{ // Test CreateInitKubeConfigFiles (wrapper to createKubeConfigFile)
|
|
||||||
name: "CreateInitKubeConfigFiles",
|
|
||||||
createKubeConfigFunction: CreateInitKubeConfigFiles,
|
|
||||||
expectedFiles: []string{
|
|
||||||
kubeadmconstants.AdminKubeConfigFileName,
|
|
||||||
kubeadmconstants.KubeletKubeConfigFileName,
|
|
||||||
kubeadmconstants.ControllerManagerKubeConfigFileName,
|
|
||||||
kubeadmconstants.SchedulerKubeConfigFileName,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{ // Test CreateJoinControlPlaneKubeConfigFiles (wrapper to createKubeConfigFile)
|
{ // Test CreateJoinControlPlaneKubeConfigFiles (wrapper to createKubeConfigFile)
|
||||||
name: "CreateJoinControlPlaneKubeConfigFiles",
|
name: "CreateJoinControlPlaneKubeConfigFiles",
|
||||||
createKubeConfigFunction: CreateJoinControlPlaneKubeConfigFiles,
|
createKubeConfigFunction: CreateJoinControlPlaneKubeConfigFiles,
|
||||||
|
Loading…
Reference in New Issue
Block a user