From af231b09e41ae83ba4af068cc41f1f5d7340b354 Mon Sep 17 00:00:00 2001 From: Babatunde Olu-Isa Date: Mon, 18 Nov 2019 00:28:28 -0800 Subject: [PATCH] remove Kubeadm-env file overwrite from apply and node command --- cmd/kubeadm/app/phases/upgrade/postupgrade.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/cmd/kubeadm/app/phases/upgrade/postupgrade.go b/cmd/kubeadm/app/phases/upgrade/postupgrade.go index ae9a0483f47..aba66687839 100644 --- a/cmd/kubeadm/app/phases/upgrade/postupgrade.go +++ b/cmd/kubeadm/app/phases/upgrade/postupgrade.go @@ -18,7 +18,6 @@ package upgrade import ( "os" - "path/filepath" "github.com/pkg/errors" @@ -160,20 +159,6 @@ func writeKubeletConfigFiles(client clientset.Interface, cfg *kubeadmapi.InitCon if dryRun { // Print what contents would be written dryrunutil.PrintDryRunFile(kubeadmconstants.KubeletConfigurationFileName, kubeletDir, kubeadmconstants.KubeletRunDirectory, os.Stdout) } - - envFilePath := filepath.Join(kubeadmconstants.KubeletRunDirectory, kubeadmconstants.KubeletEnvFileName) - if _, err := os.Stat(envFilePath); os.IsNotExist(err) { - // Write env file with flags for the kubelet to use. We do not need to write the --register-with-taints for the control-plane, - // as we handle that ourselves in the mark-control-plane phase - // TODO: Maybe we want to do that some time in the future, in order to remove some logic from the mark-control-plane phase? - if err := kubeletphase.WriteKubeletDynamicEnvFile(&cfg.ClusterConfiguration, &cfg.NodeRegistration, false, kubeletDir); err != nil { - errs = append(errs, errors.Wrap(err, "error writing a dynamic environment file for the kubelet")) - } - - if dryRun { // Print what contents would be written - dryrunutil.PrintDryRunFile(kubeadmconstants.KubeletEnvFileName, kubeletDir, kubeadmconstants.KubeletRunDirectory, os.Stdout) - } - } return errorsutil.NewAggregate(errs) }