Skip to content

Commit 231279d

Browse files
authored
Merge pull request kubernetes#74723 from rojkov/kubeadm-infof
kubeadm: use Infoln instead of Infof where appropriate
2 parents a3cace3 + bb8f4ac commit 231279d

File tree

10 files changed

+25
-25
lines changed

10 files changed

+25
-25
lines changed

cmd/kubeadm/app/cmd/phases/init/etcd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func runEtcdPhaseLocal() func(c workflow.RunData) error {
9797
return errors.Wrap(err, "error creating local etcd static pod manifest file")
9898
}
9999
} else {
100-
klog.V(1).Infof("[etcd] External etcd mode. Skipping the creation of a manifest for local etcd")
100+
klog.V(1).Infoln("[etcd] External etcd mode. Skipping the creation of a manifest for local etcd")
101101
}
102102
return nil
103103
}

cmd/kubeadm/app/cmd/phases/init/kubelet.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func runKubeletStart(c workflow.RunData) error {
5858
// First off, configure the kubelet. In this short timeframe, kubeadm is trying to stop/restart the kubelet
5959
// Try to stop the kubelet service so no race conditions occur when configuring it
6060
if !data.DryRun() {
61-
klog.V(1).Infof("Stopping the kubelet")
61+
klog.V(1).Infoln("Stopping the kubelet")
6262
kubeletphase.TryStopKubelet()
6363
}
6464

@@ -76,7 +76,7 @@ func runKubeletStart(c workflow.RunData) error {
7676

7777
// Try to start the kubelet service in case it's inactive
7878
if !data.DryRun() {
79-
klog.V(1).Infof("Starting the kubelet")
79+
klog.V(1).Infoln("Starting the kubelet")
8080
kubeletphase.TryStartKubelet()
8181
}
8282

cmd/kubeadm/app/cmd/phases/init/uploadcerts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func runUploadCerts(c workflow.RunData) error {
5050
}
5151

5252
if !data.UploadCerts() {
53-
klog.V(1).Infof("[upload-certs] Skipping certs upload")
53+
klog.V(1).Infoln("[upload-certs] Skipping certs upload")
5454
return nil
5555
}
5656
client, err := data.Client()

cmd/kubeadm/app/cmd/phases/init/uploadconfig.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func runUploadKubeadmConfig(c workflow.RunData) error {
106106
return err
107107
}
108108

109-
klog.V(1).Infof("[upload-config] Uploading the kubeadm ClusterConfiguration to a ConfigMap")
109+
klog.V(1).Infoln("[upload-config] Uploading the kubeadm ClusterConfiguration to a ConfigMap")
110110
if err := uploadconfig.UploadConfiguration(cfg, client); err != nil {
111111
return errors.Wrap(err, "error uploading the kubeadm ClusterConfiguration")
112112
}
@@ -120,12 +120,12 @@ func runUploadKubeletConfig(c workflow.RunData) error {
120120
return err
121121
}
122122

123-
klog.V(1).Infof("[upload-config] Uploading the kubelet component config to a ConfigMap")
123+
klog.V(1).Infoln("[upload-config] Uploading the kubelet component config to a ConfigMap")
124124
if err = kubeletphase.CreateConfigMap(cfg.ClusterConfiguration.ComponentConfigs.Kubelet, cfg.KubernetesVersion, client); err != nil {
125125
return errors.Wrap(err, "error creating kubelet configuration ConfigMap")
126126
}
127127

128-
klog.V(1).Infof("[upload-config] Preserving the CRISocket information for the control-plane node")
128+
klog.V(1).Infoln("[upload-config] Preserving the CRISocket information for the control-plane node")
129129
if err := patchnodephase.AnnotateCRISocket(client, cfg.NodeRegistration.Name, cfg.NodeRegistration.CRISocket); err != nil {
130130
return errors.Wrap(err, "Error writing Crisocket information for the control-plane node")
131131
}

cmd/kubeadm/app/cmd/phases/init/waitcontrolplane.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func runWaitControlPlanePhase(c workflow.RunData) error {
7777
}
7878

7979
// waiter holds the apiclient.Waiter implementation of choice, responsible for querying the API server in various ways and waiting for conditions to be fulfilled
80-
klog.V(1).Infof("[wait-control-plane] Waiting for the API server to be healthy")
80+
klog.V(1).Infoln("[wait-control-plane] Waiting for the API server to be healthy")
8181

8282
client, err := data.Client()
8383
if err != nil {

cmd/kubeadm/app/cmd/phases/join/kubelet.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func runKubeletStartJoinPhase(c workflow.RunData) error {
126126

127127
// Configure the kubelet. In this short timeframe, kubeadm is trying to stop/restart the kubelet
128128
// Try to stop the kubelet service so no race conditions occur when configuring it
129-
klog.V(1).Infof("[kubelet-start] Stopping the kubelet")
129+
klog.V(1).Infoln("[kubelet-start] Stopping the kubelet")
130130
kubeletphase.TryStopKubelet()
131131

132132
// Write the configuration for the kubelet (using the bootstrap token credentials) to disk so the kubelet can start
@@ -143,7 +143,7 @@ func runKubeletStartJoinPhase(c workflow.RunData) error {
143143
}
144144

145145
// Try to start the kubelet service in case it's inactive
146-
klog.V(1).Infof("[kubelet-start] Starting the kubelet")
146+
klog.V(1).Infoln("[kubelet-start] Starting the kubelet")
147147
kubeletphase.TryStartKubelet()
148148

149149
// Now the kubelet will perform the TLS Bootstrap, transforming /etc/kubernetes/bootstrap-kubelet.conf to /etc/kubernetes/kubelet.conf
@@ -161,7 +161,7 @@ func runKubeletStartJoinPhase(c workflow.RunData) error {
161161
return err
162162
}
163163

164-
klog.V(1).Infof("[kubelet-start] preserving the crisocket information for the node")
164+
klog.V(1).Infoln("[kubelet-start] preserving the crisocket information for the node")
165165
if err := patchnodephase.AnnotateCRISocket(client, cfg.NodeRegistration.Name, cfg.NodeRegistration.CRISocket); err != nil {
166166
return errors.Wrap(err, "error uploading crisocket")
167167
}

cmd/kubeadm/app/cmd/reset.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func (r *Reset) Run(out io.Writer, client clientset.Interface, cfg *kubeadmapi.I
142142
// Only clear etcd data when using local etcd.
143143
etcdManifestPath := filepath.Join(kubeadmconstants.KubernetesDir, kubeadmconstants.ManifestsSubDirName, "etcd.yaml")
144144

145-
klog.V(1).Infof("[reset] checking for etcd config")
145+
klog.V(1).Infoln("[reset] checking for etcd config")
146146
etcdDataDir, err := getEtcdDataDir(etcdManifestPath, cfg)
147147
if err == nil {
148148
dirsToClean = append(dirsToClean, etcdDataDir)
@@ -157,7 +157,7 @@ func (r *Reset) Run(out io.Writer, client clientset.Interface, cfg *kubeadmapi.I
157157
}
158158

159159
// Try to stop the kubelet service
160-
klog.V(1).Infof("[reset] getting init system")
160+
klog.V(1).Infoln("[reset] getting init system")
161161
initSystem, err := initsystem.GetInitSystem()
162162
if err != nil {
163163
klog.Warningln("[reset] the kubelet service could not be stopped by kubeadm. Unable to detect a supported init system!")

cmd/kubeadm/app/cmd/upgrade/apply.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ func NewCmdApply(apf *applyPlanFlags) *cobra.Command {
114114
func runApply(flags *applyFlags, userVersion string) error {
115115

116116
// Start with the basics, verify that the cluster is healthy and get the configuration from the cluster (using the ConfigMap)
117-
klog.V(1).Infof("[upgrade/apply] verifying health of cluster")
118-
klog.V(1).Infof("[upgrade/apply] retrieving configuration from cluster")
117+
klog.V(1).Infoln("[upgrade/apply] verifying health of cluster")
118+
klog.V(1).Infoln("[upgrade/apply] retrieving configuration from cluster")
119119
client, versionGetter, cfg, err := enforceRequirements(flags.applyPlanFlags, flags.dryRun, userVersion)
120120
if err != nil {
121121
return err
@@ -127,7 +127,7 @@ func runApply(flags *applyFlags, userVersion string) error {
127127
}
128128

129129
// Validate requested and validate actual version
130-
klog.V(1).Infof("[upgrade/apply] validating requested and actual version")
130+
klog.V(1).Infoln("[upgrade/apply] validating requested and actual version")
131131
if err := configutil.NormalizeKubernetesVersion(&cfg.ClusterConfiguration); err != nil {
132132
return err
133133
}
@@ -143,7 +143,7 @@ func runApply(flags *applyFlags, userVersion string) error {
143143
}
144144

145145
// Enforce the version skew policies
146-
klog.V(1).Infof("[upgrade/version] enforcing version skew policies")
146+
klog.V(1).Infoln("[upgrade/version] enforcing version skew policies")
147147
if err := EnforceVersionPolicies(cfg.KubernetesVersion, newK8sVersion, flags, versionGetter); err != nil {
148148
return errors.Wrap(err, "[upgrade/version] FATAL")
149149
}
@@ -159,7 +159,7 @@ func runApply(flags *applyFlags, userVersion string) error {
159159

160160
// Use a prepuller implementation based on creating DaemonSets
161161
// and block until all DaemonSets are ready; then we know for sure that all control plane images are cached locally
162-
klog.V(1).Infof("[upgrade/apply] creating prepuller")
162+
klog.V(1).Infoln("[upgrade/apply] creating prepuller")
163163
prepuller := upgrade.NewDaemonSetPrepuller(client, waiter, &cfg.ClusterConfiguration)
164164
componentsToPrepull := constants.ControlPlaneComponents
165165
if cfg.Etcd.External == nil && flags.etcdUpgrade {
@@ -170,13 +170,13 @@ func runApply(flags *applyFlags, userVersion string) error {
170170
}
171171

172172
// Now; perform the upgrade procedure
173-
klog.V(1).Infof("[upgrade/apply] performing upgrade")
173+
klog.V(1).Infoln("[upgrade/apply] performing upgrade")
174174
if err := PerformControlPlaneUpgrade(flags, client, waiter, cfg); err != nil {
175175
return errors.Wrap(err, "[upgrade/apply] FATAL")
176176
}
177177

178178
// Upgrade RBAC rules and addons.
179-
klog.V(1).Infof("[upgrade/postupgrade] upgrading RBAC rules and addons")
179+
klog.V(1).Infoln("[upgrade/postupgrade] upgrading RBAC rules and addons")
180180
if err := upgrade.PerformPostUpgradeTasks(client, cfg, newK8sVersion, flags.dryRun); err != nil {
181181
return errors.Wrap(err, "[upgrade/postupgrade] FATAL post-upgrade error")
182182
}

cmd/kubeadm/app/cmd/upgrade/plan.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ func NewCmdPlan(apf *applyPlanFlags) *cobra.Command {
6464
// runPlan takes care of outputting available versions to upgrade to for the user
6565
func runPlan(flags *planFlags, userVersion string) error {
6666
// Start with the basics, verify that the cluster is healthy, build a client and a versionGetter. Never dry-run when planning.
67-
klog.V(1).Infof("[upgrade/plan] verifying health of cluster")
68-
klog.V(1).Infof("[upgrade/plan] retrieving configuration from cluster")
67+
klog.V(1).Infoln("[upgrade/plan] verifying health of cluster")
68+
klog.V(1).Infoln("[upgrade/plan] retrieving configuration from cluster")
6969
client, versionGetter, cfg, err := enforceRequirements(flags.applyPlanFlags, false, userVersion)
7070
if err != nil {
7171
return err
@@ -91,7 +91,7 @@ func runPlan(flags *planFlags, userVersion string) error {
9191
}
9292

9393
// Compute which upgrade possibilities there are
94-
klog.V(1).Infof("[upgrade/plan] computing upgrade possibilities")
94+
klog.V(1).Infoln("[upgrade/plan] computing upgrade possibilities")
9595
availUpgrades, err := upgrade.GetAvailableUpgrades(versionGetter, flags.allowExperimentalUpgrades, flags.allowRCUpgrades, etcdClient, cfg.DNS.Type, client)
9696
if err != nil {
9797
return errors.Wrap(err, "[upgrade/versions] FATAL")

cmd/kubeadm/app/preflight/checks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ func (HostnameCheck) Name() string {
409409

410410
// Check validates if hostname match dns sub domain regex.
411411
func (hc HostnameCheck) Check() (warnings, errorList []error) {
412-
klog.V(1).Infof("checking whether the given node name is reachable using net.LookupHost")
412+
klog.V(1).Infoln("checking whether the given node name is reachable using net.LookupHost")
413413
errorList = []error{}
414414
warnings = []error{}
415415
addr, err := net.LookupHost(hc.nodeName)
@@ -436,7 +436,7 @@ func (hst HTTPProxyCheck) Name() string {
436436

437437
// Check validates http connectivity type, direct or via proxy.
438438
func (hst HTTPProxyCheck) Check() (warnings, errorList []error) {
439-
klog.V(1).Infof("validating if the connectivity type is via proxy or direct")
439+
klog.V(1).Infoln("validating if the connectivity type is via proxy or direct")
440440
u := (&url.URL{Scheme: hst.Proto, Host: hst.Host}).String()
441441

442442
req, err := http.NewRequest("GET", u, nil)

0 commit comments

Comments
 (0)