-
Notifications
You must be signed in to change notification settings - Fork 39
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
base: main
Are you sure you want to change the base?
fix terminal addons #166
Conversation
4189db8
to
356d989
Compare
@rushmash91: The following test failed, say
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
[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:
Approvers can indicate their approval by writing |
There was a problem hiding this 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
There was a problem hiding this comment.
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".
// 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) | ||
} |
There was a problem hiding this comment.
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") { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
func addonInFailedState(r *resource) bool { | |
func addonHasFailed(r *resource) bool { |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
?
fixes aws-controllers-k8s/community#2569
Description of changes:
Fixes addon error handling by removing
CREATE_FAILED
andUPDATE_FAILED
from terminal statuses and adding retry recovery. The controller now detects when addons are in failed states and forcesUpdateAddon
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.