Skip to content

Commit

Permalink
renamed updateRetryRequired to updateRetryPeriod
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu-kun committed Dec 15, 2023
1 parent 9d41bf7 commit c93ce96
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions pkg/util/provider/machinecontroller/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ func (c *controller) triggerCreationFlow(ctx context.Context, createMachineReque
}

// machine obj marked Failed for double security
updateRetryRequired, updateErr := c.machineStatusUpdate(
updateRetryPeriod, updateErr := c.machineStatusUpdate(
ctx,
machine,
v1alpha1.LastOperation{
Expand All @@ -461,7 +461,7 @@ func (c *controller) triggerCreationFlow(ctx context.Context, createMachineReque
)

if updateErr != nil {
return updateRetryRequired, updateErr
return updateRetryPeriod, updateErr
}

klog.V(2).Infof("Machine %q marked Failed as VM was referring to a stale node object", machine.Name)
Expand All @@ -475,7 +475,7 @@ func (c *controller) triggerCreationFlow(ctx context.Context, createMachineReque
case codes.Unknown, codes.DeadlineExceeded, codes.Aborted, codes.Unavailable:
// GetMachineStatus() returned with one of the above error codes.
// Retry operation.
updateRetryRequired, updateErr := c.machineStatusUpdate(
updateRetryPeriod, updateErr := c.machineStatusUpdate(
ctx,
machine,
v1alpha1.LastOperation{
Expand All @@ -491,13 +491,13 @@ func (c *controller) triggerCreationFlow(ctx context.Context, createMachineReque
machine.Status.LastKnownState,
)
if updateErr != nil {
return updateRetryRequired, updateErr
return updateRetryPeriod, updateErr
}

return machineutils.ShortRetry, err

default:
updateRetryRequired, updateErr := c.machineStatusUpdate(
updateRetryPeriod, updateErr := c.machineStatusUpdate(
ctx,
machine,
v1alpha1.LastOperation{
Expand All @@ -513,7 +513,7 @@ func (c *controller) triggerCreationFlow(ctx context.Context, createMachineReque
machine.Status.LastKnownState,
)
if updateErr != nil {
return updateRetryRequired, updateErr
return updateRetryPeriod, updateErr
}

return machineutils.MediumRetry, err
Expand Down
24 changes: 12 additions & 12 deletions pkg/util/provider/machinecontroller/machine_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ func (c *controller) machineCreateErrorHandler(ctx context.Context, machine *v1a
lastKnownState = createMachineResponse.LastKnownState
}

updateRetryRequired, updateErr := c.machineStatusUpdate(
updateRetryPeriod, updateErr := c.machineStatusUpdate(
ctx,
machine,
v1alpha1.LastOperation{
Expand All @@ -500,7 +500,7 @@ func (c *controller) machineCreateErrorHandler(ctx context.Context, machine *v1a
)

if updateErr != nil {
return updateRetryRequired, updateErr
return updateRetryPeriod, updateErr
}

return retryRequired, err
Expand Down Expand Up @@ -969,7 +969,7 @@ func (c *controller) getVMStatus(ctx context.Context, getMachineStatusRequest *d
}
}

updateRetryRequired, updateErr := c.machineStatusUpdate(
updateRetryPeriod, updateErr := c.machineStatusUpdate(
ctx,
getMachineStatusRequest.Machine,
v1alpha1.LastOperation{
Expand All @@ -986,7 +986,7 @@ func (c *controller) getVMStatus(ctx context.Context, getMachineStatusRequest *d
)

if updateErr != nil {
return updateRetryRequired, updateErr
return updateRetryPeriod, updateErr
}

return retry, err
Expand Down Expand Up @@ -1172,7 +1172,7 @@ func (c *controller) drainNode(ctx context.Context, deleteMachineRequest *driver
}
}

updateRetryRequired, updateErr := c.machineStatusUpdate(
updateRetryPeriod, updateErr := c.machineStatusUpdate(
ctx,
machine,
v1alpha1.LastOperation{
Expand All @@ -1189,7 +1189,7 @@ func (c *controller) drainNode(ctx context.Context, deleteMachineRequest *driver
)

if updateErr != nil {
return updateRetryRequired, updateErr
return updateRetryPeriod, updateErr
}

return machineutils.ShortRetry, err
Expand Down Expand Up @@ -1240,7 +1240,7 @@ func (c *controller) deleteNodeVolAttachments(ctx context.Context, deleteMachine
}
now := metav1.Now()
klog.V(4).Infof("(deleteVolumeAttachmentsForNode) For node %q, machine %q, set LastOperation.Description: %q", nodeName, machine.Name, description)
updateRetryRequired, updateErr := c.machineStatusUpdate(
updateRetryPeriod, updateErr := c.machineStatusUpdate(
ctx,
machine,
v1alpha1.LastOperation{
Expand All @@ -1254,7 +1254,7 @@ func (c *controller) deleteNodeVolAttachments(ctx context.Context, deleteMachine
)

if updateErr != nil {
return updateRetryRequired, updateErr
return updateRetryPeriod, updateErr
}

return retryPeriod, err
Expand Down Expand Up @@ -1308,7 +1308,7 @@ func (c *controller) deleteVM(ctx context.Context, deleteMachineRequest *driver.
lastKnownState = deleteMachineResponse.LastKnownState
}

updateRetryRequired, updateErr := c.machineStatusUpdate(
updateRetryPeriod, updateErr := c.machineStatusUpdate(
ctx,
machine,
v1alpha1.LastOperation{
Expand All @@ -1325,7 +1325,7 @@ func (c *controller) deleteVM(ctx context.Context, deleteMachineRequest *driver.
)

if updateErr != nil {
return updateRetryRequired, updateErr
return updateRetryPeriod, updateErr
}

return retryRequired, err
Expand Down Expand Up @@ -1364,7 +1364,7 @@ func (c *controller) deleteNodeObject(ctx context.Context, machine *v1alpha1.Mac
err = fmt.Errorf("Machine deletion in process. No node object found")
}

updateRetryRequired, updateErr := c.machineStatusUpdate(
updateRetryPeriod, updateErr := c.machineStatusUpdate(
ctx,
machine,
v1alpha1.LastOperation{
Expand All @@ -1381,7 +1381,7 @@ func (c *controller) deleteNodeObject(ctx context.Context, machine *v1alpha1.Mac
)

if updateErr != nil {
return updateRetryRequired, updateErr
return updateRetryPeriod, updateErr
}

return machineutils.ShortRetry, err
Expand Down

0 comments on commit c93ce96

Please sign in to comment.