chore: classify controller errors as terminal vs non-terminal - #9542
Open
ketanjani21 wants to merge 1 commit into
Open
chore: classify controller errors as terminal vs non-terminal#9542ketanjani21 wants to merge 1 commit into
ketanjani21 wants to merge 1 commit into
Conversation
ketanjani21
force-pushed
the
fix/classify-controller-errors-7837
branch
from
August 25, 2026 17:54
1c75a90 to
c7b4978
Compare
ketanjani21
force-pushed
the
fix/classify-controller-errors-7837
branch
from
August 25, 2026 19:02
c7b4978 to
9881d0f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7837
Description
Reconcilers for
AMI,CapacityReservation,InstanceProfile,SecurityGroup, andSubnetclasses leave theirReadystatus condition inUnknownon every AWS API error, even when the error is not retryable (IAM misconfiguration, account service-limit hit, etc.). Users have no user-visible signal for the "needs operator action" cases, and the reconciler retries indefinitely.This PR adds a small
ClassifyErrorhelper inpkg/errorsthat inspects AWS API errors, matches known terminal codes, and returns a(reason, message, retryable)triple. Each of the five nodeclass reconcilers now calls it in its error path. When the error is terminal, the correspondingReadycondition is set toFalsewith the classified reason and message. Transient or unrecognized errors keep the existing behavior (return error, retry).Terminal codes covered in this pass:
UnauthorizedOperation/AccessDenied/AccessDeniedException/AuthFailure— IAM misconfiguration; retrying without operator action will not succeed.LimitExceeded— account service-limit reached; requires a quota increase or resource cleanup.The list is intentionally conservative; more codes can be added in follow-ups as they surface.
Reference to prior work
Supersedes #7903 (@saku3), which was closed without merging in January 2026. I confirmed with @saku3 on 2026-08-22 that they are not actively working on this. This PR takes a similar approach in a smaller, more targeted form.
How was this change tested?
pkg/errors/errors_test.gocovering:nilinput, non-AWS errors, each of the terminal codes returningretryable=false, and unknown codes returningretryable=true.go build ./...andgo vet ./pkg/...clean.SetFalsecall precedes the existingreturn err(so retries still happen when the code drops the terminal branch on a code we did not classify).By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.