Skip to content
Snippets Groups Projects
Unverified Commit 2c9f331e authored by Damiano Donati's avatar Damiano Donati
Browse files

fix linting

parent bf297b60
No related branches found
No related tags found
No related merge requests found
......@@ -209,6 +209,7 @@ func (r *ReconcileMachine) Reconcile(ctx context.Context, request reconcile.Requ
PausedCondition,
NotPausedConditionReason,
machinev1.ConditionSeverityInfo,
"%s",
pausedFalseReason,
))
if patchErr := r.updateStatus(ctx, m, ptr.Deref(m.Status.Phase, ""), nil, originalConditions); patchErr != nil {
......
......@@ -346,7 +346,7 @@ func (r *ReconcileMachineHealthCheck) externalRemediation(ctx context.Context, m
}
from, err := external.Get(ctx, r.client, m.Spec.RemediationTemplate, t.Machine.Namespace)
if err != nil {
conditions.MarkFalse(m, machinev1.ExternalRemediationTemplateAvailable, machinev1.ExternalRemediationTemplateNotFound, machinev1.ConditionSeverityError, err.Error())
conditions.MarkFalse(m, machinev1.ExternalRemediationTemplateAvailable, machinev1.ExternalRemediationTemplateNotFound, machinev1.ConditionSeverityError, "%s", err.Error())
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)
}
......@@ -372,7 +372,7 @@ func (r *ReconcileMachineHealthCheck) externalRemediation(ctx context.Context, m
klog.V(3).Info("Target has failed health check, creating an external remediation request", "remediation request name", to.GetName(), "target", t.string())
// Create the external clone.
if err := r.client.Create(ctx, to); err != nil {
conditions.MarkFalse(m, machinev1.ExternalRemediationRequestAvailable, machinev1.ExternalRemediationRequestCreationFailed, machinev1.ConditionSeverityError, err.Error())
conditions.MarkFalse(m, machinev1.ExternalRemediationRequestAvailable, machinev1.ExternalRemediationRequestCreationFailed, machinev1.ConditionSeverityError, "%s", err.Error())
return fmt.Errorf("error creating remediation request for machine %q in namespace %q: %v", t.Machine.Name, t.Machine.Namespace, err)
}
return nil
......
......@@ -209,6 +209,7 @@ func (r *ReconcileMachineSet) Reconcile(ctx context.Context, request reconcile.R
machine.PausedCondition,
machine.NotPausedConditionReason,
machinev1.ConditionSeverityInfo,
"%s",
pausedFalseReason,
))
machineSet, err := updateMachineSetStatus(r.Client, machineSet, machineSetCopy.Status)
......
......@@ -96,12 +96,12 @@ func updateMachineSetStatus(c client.Client, ms *machinev1.MachineSet, newStatus
if ms.Spec.Replicas != nil {
replicas = *ms.Spec.Replicas
}
klog.V(4).Infof(fmt.Sprintf("Updating status for %v: %s/%s, ", ms.Kind, ms.Namespace, ms.Name) +
fmt.Sprintf("replicas %d->%d (need %d), ", ms.Status.Replicas, newStatus.Replicas, replicas) +
fmt.Sprintf("fullyLabeledReplicas %d->%d, ", ms.Status.FullyLabeledReplicas, newStatus.FullyLabeledReplicas) +
fmt.Sprintf("readyReplicas %d->%d, ", ms.Status.ReadyReplicas, newStatus.ReadyReplicas) +
fmt.Sprintf("availableReplicas %d->%d, ", ms.Status.AvailableReplicas, newStatus.AvailableReplicas) +
fmt.Sprintf("sequence No: %v->%v", ms.Status.ObservedGeneration, newStatus.ObservedGeneration) +
klog.V(4).Infof("%s", fmt.Sprintf("Updating status for %v: %s/%s, ", ms.Kind, ms.Namespace, ms.Name)+
fmt.Sprintf("replicas %d->%d (need %d), ", ms.Status.Replicas, newStatus.Replicas, replicas)+
fmt.Sprintf("fullyLabeledReplicas %d->%d, ", ms.Status.FullyLabeledReplicas, newStatus.FullyLabeledReplicas)+
fmt.Sprintf("readyReplicas %d->%d, ", ms.Status.ReadyReplicas, newStatus.ReadyReplicas)+
fmt.Sprintf("availableReplicas %d->%d, ", ms.Status.AvailableReplicas, newStatus.AvailableReplicas)+
fmt.Sprintf("sequence No: %v->%v", ms.Status.ObservedGeneration, newStatus.ObservedGeneration)+
fmt.Sprintf("conditions: %v->%v", ms.Status.Conditions, newStatus.Conditions))
ms.Status = newStatus
......
......@@ -194,7 +194,7 @@ func (r *Reconciler) create() error {
if statusError != nil {
return fmt.Errorf("failed to set provider status: %w", statusError)
}
return machinecontroller.CreateMachine(err.Error())
return machinecontroller.CreateMachine("%s", err.Error())
} else {
return fmt.Errorf("failed to check task status: %w", err)
}
......@@ -867,12 +867,10 @@ func clone(s *machineScope) (string, error) {
}
if hwVersion < minimumHWVersion {
return "", machinecontroller.InvalidMachineConfiguration(
fmt.Sprintf(
"Hardware lower than %d is not supported, clone stopped. "+
"Detected machine template version is %d. "+
"Please update machine template: https://docs.openshift.com/container-platform/latest/updating/updating_a_cluster/updating-hardware-on-nodes-running-on-vsphere.html",
minimumHWVersion, hwVersion,
),
"Hardware lower than %d is not supported, clone stopped. "+
"Detected machine template version is %d. "+
"Please update machine template: https://docs.openshift.com/container-platform/latest/updating/updating_a_cluster/updating-hardware-on-nodes-running-on-vsphere.html",
minimumHWVersion, hwVersion,
)
}
......@@ -1225,12 +1223,12 @@ func setProviderStatus(taskRef string, condition metav1.Condition, scope *machin
func handleVSphereError(multipleFoundMsg, notFoundMsg string, defaultError, vsphereError error) error {
var multipleFoundError *find.MultipleFoundError
if errors.As(vsphereError, &multipleFoundError) {
return machinecontroller.InvalidMachineConfiguration(multipleFoundMsg)
return machinecontroller.InvalidMachineConfiguration("%s", multipleFoundMsg)
}
var notFoundError *find.NotFoundError
if errors.As(vsphereError, &notFoundError) {
return machinecontroller.InvalidMachineConfiguration(notFoundMsg)
return machinecontroller.InvalidMachineConfiguration("%s", notFoundMsg)
}
return defaultError
......
......@@ -138,7 +138,7 @@ func (t *CachingTagsManager) GetTag(ctx context.Context, id string) (*tags.Tag,
klog.V(4).Infof("tag %s: found cached tag id value", id)
if cachedTagID == notFoundValue {
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)
return nil, fmt.Errorf(notFoundErrMessage)
return nil, fmt.Errorf("%s", notFoundErrMessage)
}
tag, err := t.Manager.GetTag(ctx, cachedTagID)
......@@ -191,7 +191,7 @@ func (t *CachingTagsManager) GetCategory(ctx context.Context, id string) (*tags.
klog.V(4).Infof("category %s: found cached category id value", id)
if cachedCategoryID == notFoundValue {
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)
return nil, fmt.Errorf(notFoundErrMessage)
return nil, fmt.Errorf("%s", notFoundErrMessage)
}
category, err := t.Manager.GetCategory(ctx, cachedCategoryID)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment