Skip to content

Commit

Permalink
Merge branch 'main' into backup-app
Browse files Browse the repository at this point in the history
  • Loading branch information
akgalwas authored Dec 17, 2024
2 parents 38be434 + 764dfbf commit d037331
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
4 changes: 2 additions & 2 deletions internal/controller/runtime/fsm/runtime_fsm_configure_oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 13 additions & 1 deletion pkg/gardener/gardener_error_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions pkg/gardener/gardener_error_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
}
}

Expand Down Expand Up @@ -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,
},
Expand Down

0 comments on commit d037331

Please sign in to comment.