-
Notifications
You must be signed in to change notification settings - Fork 190
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
Adding status reporting for RecoverableCondition #40
Conversation
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.
Apologies, @jkuruba, I changed my mind about naming this ConditionTypeNonTerminal... see the PR review on the runtime repo. Other than the name change, though, I'm good with this.
templates/pkg/resource/sdk.go.tpl
Outdated
// If terminal condition exists, other errors will | ||
// will not be reported |
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.
This isn't actually true, though, right? If a NonTerminalCondition is found first in the list of Condition structs, we will still end up "reporting" that NonTerminalCondition...
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.
Yes, it was an oversight and I thought we were checking for the existing TerminalCondition below, but we are actually checking if the new error is Terminal. I fixed the comment to indicate that we continue to look for TerminalCondition even if we find a RecoverableError. TerminalCondition takes higher priority to display status as the sync stops.
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.
No worries, was just making sure I was reading the logic right :)
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.
👍 thank you @jkuruba! :)
Issue #, if available: aws-controllers-k8s/community#498
Description of changes: RecoverableCondition is used to report errors that are not marked as Terminal. Currently controllers sync silently and errors are not reported. Reporting will notify Recoverable errors that can likely be fixed without re-applying the spec.
Testing: Ran reconciler unit tests
go test -v
=== RUN TestReconcilerUpdate
2021-04-05T18:51:38.576Z INFO ackrt updated resource {"kind": "Book", "namespace": "default", "name": "mybook", "generation": 1, "is_adopted": false}
--- PASS: TestReconcilerUpdate (0.00s)
=== RUN TestRegistry
--- PASS: TestRegistry (0.00s)
=== RUN TestServiceController
--- PASS: TestServiceController (0.00s)
=== RUN TestIsAdopted
--- PASS: TestIsAdopted (0.00s)
=== RUN TestIsSynced
--- PASS: TestIsSynced (0.00s)
PASS
ok github.com/aws-controllers-k8s/runtime/pkg/runtime 0.016s
Also, tested if the errors are reported in SageMaker manually for AccessDeniedException.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.