Skip to content

fix terminal addons #166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rushmash91
Copy link
Member

fixes aws-controllers-k8s/community#2569

Description of changes:
Fixes addon error handling by removing CREATE_FAILED and UPDATE_FAILED from terminal statuses and adding retry recovery. The controller now detects when addons are in failed states and forces UpdateAddon calls regardless of spec changes. This ensures addons can transition from failed states back to ACTIVE through continuous reconciliation attempts.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow ack-prow bot requested review from jlbutler and michaelhtm August 4, 2025 22:41
@ack-prow ack-prow bot added the approved label Aug 4, 2025
@rushmash91 rushmash91 force-pushed the feature/addon-retry-logic-for-failed-states branch from 4189db8 to 356d989 Compare August 6, 2025 19:27
Copy link

ack-prow bot commented Aug 6, 2025

@rushmash91: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
eks-verify-attribution 356d989 link false /test eks-verify-attribution

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link

ack-prow bot commented Aug 6, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, rushmash91

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [a-hilaly,rushmash91]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Member

@michaelhtm michaelhtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @rushmash91
left a few comments

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably do the inFailedState check in delta..if not, sdkUpdate will never be triggered.
To trigger sdkUpdate there needs to be a diff in "spec".

Comment on lines +20 to +24
// If addon is in failed state, we need to force an update regardless of delta
if inFailedState {
msg := "Addon is in '" + *latest.ko.Status.Status + "' status, attempting recovery"
ackcondition.SetSynced(latest, corev1.ConditionFalse, &msg, nil)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add this one in sdkFind as well

// If addon is in failed state, always attempt update to recover
// Otherwise, check if there are differences to update
if !inFailedState && !delta.DifferentExcept("Spec.Tags") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably won't need inFailedState check here if we add a new diff in delta

@@ -101,6 +99,16 @@ func addonHasTerminalStatus(r *resource) bool {
return false
}

// addonInFailedState returns true if the supplied addon is in a failed state
// that requires retry (CREATE_FAILED or UPDATE_FAILED)
func addonInFailedState(r *resource) bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
func addonInFailedState(r *resource) bool {
func addonHasFailed(r *resource) bool {

Copy link
Contributor

@knottnt knottnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rushmash91! Just left a small nit.

if r.ko.Status.Status == nil {
return false
}
cs := *r.ko.Status.Status
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: cs isn't a very descriptive name. Maybe something like addonStatus?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add retry logic for failed addon states in EKS controller
4 participants