Skip to content

Commit d0e62ca

Browse files
Merge pull request #1240 from theobarberbany/change-verbs
OCPBUGS-31777: Updates message verbs to use %q where appropriate
2 parents 5af2743 + 967b83a commit d0e62ca

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pkg/controller/machine/controller.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func (r *ReconcileMachine) Reconcile(ctx context.Context, request reconcile.Requ
163163

164164
// Implement controller logic here
165165
machineName := m.GetName()
166-
klog.Infof("%v: reconciling Machine", machineName)
166+
klog.Infof("%q: reconciling Machine", machineName)
167167

168168
// Get the original state of conditions now so that they can be used to calculate the patch later.
169169
// This must be a copy otherwise the referenced slice will be modified by later machine conditions changes.
@@ -231,14 +231,14 @@ func (r *ReconcileMachine) Reconcile(ctx context.Context, request reconcile.Requ
231231
// we can loose instances, e.g. right after request to create one
232232
// was sent and before a list of node addresses was set.
233233
if len(m.Status.Addresses) > 0 || !isInvalidMachineConfigurationError(err) {
234-
klog.Errorf("%v: failed to delete machine: %v", machineName, err)
234+
klog.Errorf("%q: failed to delete machine: %v", machineName, err)
235235
return delayIfRequeueAfterError(err)
236236
}
237237
}
238238

239239
instanceExists, err := r.actuator.Exists(ctx, m)
240240
if err != nil {
241-
klog.Errorf("%v: failed to check if machine exists: %v", machineName, err)
241+
klog.Errorf("%q: failed to check if machine exists: %v", machineName, err)
242242
return reconcile.Result{}, err
243243
}
244244

@@ -273,7 +273,7 @@ func (r *ReconcileMachine) Reconcile(ctx context.Context, request reconcile.Requ
273273

274274
instanceExists, err := r.actuator.Exists(ctx, m)
275275
if err != nil {
276-
klog.Errorf("%v: failed to check if machine exists: %v", machineName, err)
276+
klog.Errorf("%q: failed to check if machine exists: %v", machineName, err)
277277

278278
conditions.Set(m, conditions.UnknownCondition(
279279
machinev1.InstanceExistsCondition,
@@ -291,7 +291,7 @@ func (r *ReconcileMachine) Reconcile(ctx context.Context, request reconcile.Requ
291291
if instanceExists {
292292
klog.Infof("%v: reconciling machine triggers idempotent update", machineName)
293293
if err := r.actuator.Update(ctx, m); err != nil {
294-
klog.Errorf("%v: error updating machine: %v, retrying in %v seconds", machineName, err, requeueAfter)
294+
klog.Errorf("%q: error updating machine: %v, retrying in %s seconds", machineName, err, requeueAfter.String())
295295

296296
if patchErr := r.updateStatus(ctx, m, ptr.Deref(m.Status.Phase, ""), nil, originalConditions); patchErr != nil {
297297
klog.Errorf("%v: error patching status: %v", machineName, patchErr)
@@ -358,7 +358,7 @@ func (r *ReconcileMachine) Reconcile(ctx context.Context, request reconcile.Requ
358358

359359
klog.Infof("%v: reconciling machine triggers idempotent create", machineName)
360360
if err := r.actuator.Create(ctx, m); err != nil {
361-
klog.Warningf("%v: failed to create machine: %v", machineName, err)
361+
klog.Warningf("%q: failed to create machine: %v", machineName, err)
362362
if isInvalidMachineConfigurationError(err) {
363363
if err := r.updateStatus(ctx, m, machinev1.PhaseFailed, err, originalConditions); err != nil {
364364
return reconcile.Result{}, err

pkg/controller/vsphere/actuator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func NewActuator(params ActuatorParams) *Actuator {
6060
// Set corresponding event based on error. It also returns the original error
6161
// for convenience, so callers can do "return handleMachineError(...)".
6262
func (a *Actuator) handleMachineError(machine *machinev1.Machine, err error, eventAction string) error {
63-
klog.Errorf("%v error: %v", machine.GetName(), err)
63+
klog.Errorf("%q error: %v", machine.GetName(), err)
6464
if eventAction != noEventAction {
6565
a.eventRecorder.Eventf(machine, corev1.EventTypeWarning, "Failed"+eventAction, "%v", err)
6666
}

0 commit comments

Comments
 (0)