Skip to content

Commit d73a2a7

Browse files
authored
Minor fixes (#981)
* Update docstring for `MachineDeploymentFrozen` * Change retryPeriod for machines failing creation due to ResourceExhaustion
1 parent 27025af commit d73a2a7

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

pkg/apis/machine/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,8 @@ const (
653653
// or deleted.
654654
MachineDeploymentReplicaFailure MachineDeploymentConditionType = "ReplicaFailure"
655655

656-
// MachineDeploymentFrozen is added in a MachineDeployment when one of its machines fails to be created
657-
// or deleted.
656+
// MachineDeploymentFrozen is added in a MachineDeployment when one of its
657+
// machineSet has either the "freeze" label or the "Frozen" condition on it.
658658
MachineDeploymentFrozen MachineDeploymentConditionType = "Frozen"
659659
)
660660

pkg/apis/machine/v1alpha1/machinedeployment_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ const (
249249
// or deleted.
250250
MachineDeploymentReplicaFailure MachineDeploymentConditionType = "ReplicaFailure"
251251

252-
// MachineDeploymentFrozen is added in a MachineDeployment when one of its machines fails to be created
253-
// or deleted.
252+
// MachineDeploymentFrozen is added in a MachineDeployment when one of its
253+
// machineSet has either the "freeze" label or the "Frozen" condition on it.
254254
MachineDeploymentFrozen MachineDeploymentConditionType = "Frozen"
255255
)
256256

pkg/util/provider/machinecontroller/machine_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ var _ = Describe("machine", func() {
909909
},
910910
}, nil, nil, nil, true, metav1.Now()),
911911
err: status.Error(codes.ResourceExhausted, "Provider does not have capacity to create VM"),
912-
retry: machineutils.MediumRetry,
912+
retry: machineutils.LongRetry,
913913
},
914914
}),
915915
Entry("Machine creation fails with Failure due to timeout", &data{

pkg/util/provider/machinecontroller/machine_util.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,9 @@ func (c *controller) machineCreateErrorHandler(ctx context.Context, machine *v1a
728728
machineErr, ok := status.FromError(err)
729729
if ok {
730730
switch machineErr.Code() {
731+
case codes.ResourceExhausted:
732+
retryRequired = machineutils.LongRetry
733+
lastKnownState = machine.Status.LastKnownState
731734
case codes.Unknown, codes.DeadlineExceeded, codes.Aborted, codes.Unavailable:
732735
retryRequired = machineutils.ShortRetry
733736
lastKnownState = machine.Status.LastKnownState

0 commit comments

Comments
 (0)