Skip to content

Commit 2c9f331

Browse files
committed
fix linting
1 parent bf297b6 commit 2c9f331

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

pkg/controller/machine/controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ func (r *ReconcileMachine) Reconcile(ctx context.Context, request reconcile.Requ
209209
PausedCondition,
210210
NotPausedConditionReason,
211211
machinev1.ConditionSeverityInfo,
212+
"%s",
212213
pausedFalseReason,
213214
))
214215
if patchErr := r.updateStatus(ctx, m, ptr.Deref(m.Status.Phase, ""), nil, originalConditions); patchErr != nil {

pkg/controller/machinehealthcheck/machinehealthcheck_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ func (r *ReconcileMachineHealthCheck) externalRemediation(ctx context.Context, m
346346
}
347347
from, err := external.Get(ctx, r.client, m.Spec.RemediationTemplate, t.Machine.Namespace)
348348
if err != nil {
349-
conditions.MarkFalse(m, machinev1.ExternalRemediationTemplateAvailable, machinev1.ExternalRemediationTemplateNotFound, machinev1.ConditionSeverityError, err.Error())
349+
conditions.MarkFalse(m, machinev1.ExternalRemediationTemplateAvailable, machinev1.ExternalRemediationTemplateNotFound, machinev1.ConditionSeverityError, "%s", err.Error())
350350
return fmt.Errorf("error retrieving remediation template %v %q for machine %q in namespace %q: %v", m.Spec.RemediationTemplate.GroupVersionKind(), m.Spec.RemediationTemplate.Name, t.Machine.Name, t.Machine.Namespace, err)
351351
}
352352

@@ -372,7 +372,7 @@ func (r *ReconcileMachineHealthCheck) externalRemediation(ctx context.Context, m
372372
klog.V(3).Info("Target has failed health check, creating an external remediation request", "remediation request name", to.GetName(), "target", t.string())
373373
// Create the external clone.
374374
if err := r.client.Create(ctx, to); err != nil {
375-
conditions.MarkFalse(m, machinev1.ExternalRemediationRequestAvailable, machinev1.ExternalRemediationRequestCreationFailed, machinev1.ConditionSeverityError, err.Error())
375+
conditions.MarkFalse(m, machinev1.ExternalRemediationRequestAvailable, machinev1.ExternalRemediationRequestCreationFailed, machinev1.ConditionSeverityError, "%s", err.Error())
376376
return fmt.Errorf("error creating remediation request for machine %q in namespace %q: %v", t.Machine.Name, t.Machine.Namespace, err)
377377
}
378378
return nil

pkg/controller/machineset/controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ func (r *ReconcileMachineSet) Reconcile(ctx context.Context, request reconcile.R
209209
machine.PausedCondition,
210210
machine.NotPausedConditionReason,
211211
machinev1.ConditionSeverityInfo,
212+
"%s",
212213
pausedFalseReason,
213214
))
214215
machineSet, err := updateMachineSetStatus(r.Client, machineSet, machineSetCopy.Status)

pkg/controller/machineset/status.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ func updateMachineSetStatus(c client.Client, ms *machinev1.MachineSet, newStatus
9696
if ms.Spec.Replicas != nil {
9797
replicas = *ms.Spec.Replicas
9898
}
99-
klog.V(4).Infof(fmt.Sprintf("Updating status for %v: %s/%s, ", ms.Kind, ms.Namespace, ms.Name) +
100-
fmt.Sprintf("replicas %d->%d (need %d), ", ms.Status.Replicas, newStatus.Replicas, replicas) +
101-
fmt.Sprintf("fullyLabeledReplicas %d->%d, ", ms.Status.FullyLabeledReplicas, newStatus.FullyLabeledReplicas) +
102-
fmt.Sprintf("readyReplicas %d->%d, ", ms.Status.ReadyReplicas, newStatus.ReadyReplicas) +
103-
fmt.Sprintf("availableReplicas %d->%d, ", ms.Status.AvailableReplicas, newStatus.AvailableReplicas) +
104-
fmt.Sprintf("sequence No: %v->%v", ms.Status.ObservedGeneration, newStatus.ObservedGeneration) +
99+
klog.V(4).Infof("%s", fmt.Sprintf("Updating status for %v: %s/%s, ", ms.Kind, ms.Namespace, ms.Name)+
100+
fmt.Sprintf("replicas %d->%d (need %d), ", ms.Status.Replicas, newStatus.Replicas, replicas)+
101+
fmt.Sprintf("fullyLabeledReplicas %d->%d, ", ms.Status.FullyLabeledReplicas, newStatus.FullyLabeledReplicas)+
102+
fmt.Sprintf("readyReplicas %d->%d, ", ms.Status.ReadyReplicas, newStatus.ReadyReplicas)+
103+
fmt.Sprintf("availableReplicas %d->%d, ", ms.Status.AvailableReplicas, newStatus.AvailableReplicas)+
104+
fmt.Sprintf("sequence No: %v->%v", ms.Status.ObservedGeneration, newStatus.ObservedGeneration)+
105105
fmt.Sprintf("conditions: %v->%v", ms.Status.Conditions, newStatus.Conditions))
106106

107107
ms.Status = newStatus

pkg/controller/vsphere/reconciler.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func (r *Reconciler) create() error {
194194
if statusError != nil {
195195
return fmt.Errorf("failed to set provider status: %w", statusError)
196196
}
197-
return machinecontroller.CreateMachine(err.Error())
197+
return machinecontroller.CreateMachine("%s", err.Error())
198198
} else {
199199
return fmt.Errorf("failed to check task status: %w", err)
200200
}
@@ -867,12 +867,10 @@ func clone(s *machineScope) (string, error) {
867867
}
868868
if hwVersion < minimumHWVersion {
869869
return "", machinecontroller.InvalidMachineConfiguration(
870-
fmt.Sprintf(
871-
"Hardware lower than %d is not supported, clone stopped. "+
872-
"Detected machine template version is %d. "+
873-
"Please update machine template: https://docs.openshift.com/container-platform/latest/updating/updating_a_cluster/updating-hardware-on-nodes-running-on-vsphere.html",
874-
minimumHWVersion, hwVersion,
875-
),
870+
"Hardware lower than %d is not supported, clone stopped. "+
871+
"Detected machine template version is %d. "+
872+
"Please update machine template: https://docs.openshift.com/container-platform/latest/updating/updating_a_cluster/updating-hardware-on-nodes-running-on-vsphere.html",
873+
minimumHWVersion, hwVersion,
876874
)
877875
}
878876

@@ -1225,12 +1223,12 @@ func setProviderStatus(taskRef string, condition metav1.Condition, scope *machin
12251223
func handleVSphereError(multipleFoundMsg, notFoundMsg string, defaultError, vsphereError error) error {
12261224
var multipleFoundError *find.MultipleFoundError
12271225
if errors.As(vsphereError, &multipleFoundError) {
1228-
return machinecontroller.InvalidMachineConfiguration(multipleFoundMsg)
1226+
return machinecontroller.InvalidMachineConfiguration("%s", multipleFoundMsg)
12291227
}
12301228

12311229
var notFoundError *find.NotFoundError
12321230
if errors.As(vsphereError, &notFoundError) {
1233-
return machinecontroller.InvalidMachineConfiguration(notFoundMsg)
1231+
return machinecontroller.InvalidMachineConfiguration("%s", notFoundMsg)
12341232
}
12351233

12361234
return defaultError

pkg/controller/vsphere/session/tag_ids_caching_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func (t *CachingTagsManager) GetTag(ctx context.Context, id string) (*tags.Tag,
138138
klog.V(4).Infof("tag %s: found cached tag id value", id)
139139
if cachedTagID == notFoundValue {
140140
klog.V(4).Infof("tag %s: cache contains special value indicates that tag was not found when cache was filled, treating as non existed tag", id)
141-
return nil, fmt.Errorf(notFoundErrMessage)
141+
return nil, fmt.Errorf("%s", notFoundErrMessage)
142142
}
143143

144144
tag, err := t.Manager.GetTag(ctx, cachedTagID)
@@ -191,7 +191,7 @@ func (t *CachingTagsManager) GetCategory(ctx context.Context, id string) (*tags.
191191
klog.V(4).Infof("category %s: found cached category id value", id)
192192
if cachedCategoryID == notFoundValue {
193193
klog.V(4).Infof("category %s: cache contains special value indicates that tag was not found when cache was filled, treating as non existing category", id)
194-
return nil, fmt.Errorf(notFoundErrMessage)
194+
return nil, fmt.Errorf("%s", notFoundErrMessage)
195195
}
196196

197197
category, err := t.Manager.GetCategory(ctx, cachedCategoryID)

0 commit comments

Comments
 (0)