From 5d0aec6671c8fbcbc1de8c2e3007ff0197bdb063 Mon Sep 17 00:00:00 2001 From: Prashant Tak Date: Wed, 9 Apr 2025 21:32:00 +0530 Subject: [PATCH 1/2] Update docstring for `MachineDeploymentFrozen` --- pkg/apis/machine/types.go | 4 ++-- pkg/apis/machine/v1alpha1/machinedeployment_types.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/apis/machine/types.go b/pkg/apis/machine/types.go index ea6cfc07bd..134ae4f509 100644 --- a/pkg/apis/machine/types.go +++ b/pkg/apis/machine/types.go @@ -615,8 +615,8 @@ const ( // or deleted. MachineDeploymentReplicaFailure MachineDeploymentConditionType = "ReplicaFailure" - // MachineDeploymentFrozen is added in a MachineDeployment when one of its machines fails to be created - // or deleted. + // MachineDeploymentFrozen is added in a MachineDeployment when one of its + // machineSet has either the "freeze" label or the "Frozen" condition on it. MachineDeploymentFrozen MachineDeploymentConditionType = "Frozen" ) diff --git a/pkg/apis/machine/v1alpha1/machinedeployment_types.go b/pkg/apis/machine/v1alpha1/machinedeployment_types.go index edc01e2848..1839ad8665 100644 --- a/pkg/apis/machine/v1alpha1/machinedeployment_types.go +++ b/pkg/apis/machine/v1alpha1/machinedeployment_types.go @@ -249,8 +249,8 @@ const ( // or deleted. MachineDeploymentReplicaFailure MachineDeploymentConditionType = "ReplicaFailure" - // MachineDeploymentFrozen is added in a MachineDeployment when one of its machines fails to be created - // or deleted. + // MachineDeploymentFrozen is added in a MachineDeployment when one of its + // machineSet has either the "freeze" label or the "Frozen" condition on it. MachineDeploymentFrozen MachineDeploymentConditionType = "Frozen" ) From b843d381a93fa8dc58e41d4290be49043dcae201 Mon Sep 17 00:00:00 2001 From: Prashant Tak Date: Wed, 9 Apr 2025 21:39:35 +0530 Subject: [PATCH 2/2] Change retryPeriod for machines failing creation due to ResourceExhaustion --- pkg/util/provider/machinecontroller/machine_test.go | 2 +- pkg/util/provider/machinecontroller/machine_util.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/util/provider/machinecontroller/machine_test.go b/pkg/util/provider/machinecontroller/machine_test.go index 493988e870..3349d2333f 100644 --- a/pkg/util/provider/machinecontroller/machine_test.go +++ b/pkg/util/provider/machinecontroller/machine_test.go @@ -849,7 +849,7 @@ var _ = Describe("machine", func() { }, }, nil, nil, nil, true, metav1.Now()), err: status.Error(codes.ResourceExhausted, "Provider does not have capacity to create VM"), - retry: machineutils.MediumRetry, + retry: machineutils.LongRetry, }, }), Entry("Machine creation fails with Failure due to timeout", &data{ diff --git a/pkg/util/provider/machinecontroller/machine_util.go b/pkg/util/provider/machinecontroller/machine_util.go index ffd3ab4114..4df24e9a38 100644 --- a/pkg/util/provider/machinecontroller/machine_util.go +++ b/pkg/util/provider/machinecontroller/machine_util.go @@ -508,6 +508,9 @@ func (c *controller) machineCreateErrorHandler(ctx context.Context, machine *v1a machineErr, ok := status.FromError(err) if ok { switch machineErr.Code() { + case codes.ResourceExhausted: + retryRequired = machineutils.LongRetry + lastKnownState = machine.Status.LastKnownState case codes.Unknown, codes.DeadlineExceeded, codes.Aborted, codes.Unavailable: retryRequired = machineutils.ShortRetry lastKnownState = machine.Status.LastKnownState