diff --git a/internal/controller/runtime/fsm/runtime_fsm_configure_oidc.go b/internal/controller/runtime/fsm/runtime_fsm_configure_oidc.go index 51c6f6bc..e7c23916 100644 --- a/internal/controller/runtime/fsm/runtime_fsm_configure_oidc.go +++ b/internal/controller/runtime/fsm/runtime_fsm_configure_oidc.go @@ -45,9 +45,9 @@ func sFnConfigureOidc(ctx context.Context, m *fsm, s *systemState) (stateFn, *ct err := recreateOpenIDConnectResources(ctx, m, s) if err != nil { - m.log.Error(err, "Failed to create OpenIDConnect resource") updateConditionFailed(&s.instance) - return updateStatusAndStopWithError(err) + m.log.Error(err, "Failed to create OpenIDConnect resource. Scheduling for retry") + return requeue() } m.log.Info("OIDC has been configured", "Name", s.shoot.Name) diff --git a/pkg/gardener/gardener_error_handler.go b/pkg/gardener/gardener_error_handler.go index 0ae41da9..ef3d5722 100644 --- a/pkg/gardener/gardener_error_handler.go +++ b/pkg/gardener/gardener_error_handler.go @@ -13,12 +13,24 @@ type ErrReason string func IsRetryable(lastErrors []gardener.LastError) bool { if len(lastErrors) > 0 && - !gardenerhelper.HasNonRetryableErrorCode(lastErrors...) { + !gardenerhelper.HasNonRetryableErrorCode(lastErrors...) || + HasErrorInfraRateLimitsExceeded(lastErrors...) { return true } return false } +func HasErrorInfraRateLimitsExceeded(lastErrors ...gardener.LastError) bool { + for _, lastError := range lastErrors { + for _, code := range lastError.Codes { + if code == gardener.ErrorInfraRateLimitsExceeded { + return true + } + } + } + return false +} + func ToErrReason(lastErrors ...gardener.LastError) ErrReason { var codes []gardener.ErrorCode var vals []string diff --git a/pkg/gardener/gardener_error_handler_test.go b/pkg/gardener/gardener_error_handler_test.go index ac83ab22..4a558c87 100644 --- a/pkg/gardener/gardener_error_handler_test.go +++ b/pkg/gardener/gardener_error_handler_test.go @@ -78,6 +78,12 @@ func fixRetryableErrors() []gardener.LastError { gardener.ErrorRetryableInfraDependencies, }, }, + { + Description: "Third description - non-retryable error according to gardener API which we deliberately consider as retryable", + Codes: []gardener.ErrorCode{ + gardener.ErrorInfraRateLimitsExceeded, + }, + }, } } @@ -109,18 +115,12 @@ func fixNonRetryableErrors() []gardener.LastError { }, { Description: "Fifth description - non-retryable", - Codes: []gardener.ErrorCode{ - gardener.ErrorInfraRateLimitsExceeded, - }, - }, - { - Description: "Sixth description - non-retryable", Codes: []gardener.ErrorCode{ gardener.ErrorConfigurationProblem, }, }, { - Description: "Seventh description - non-retryable", + Description: "Sixth description - non-retryable", Codes: []gardener.ErrorCode{ gardener.ErrorProblematicWebhook, },