Skip to content

Conversation

@jkuruba
Copy link
Contributor

@jkuruba jkuruba commented Apr 5, 2021

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.

Copy link
Collaborator

@jaypipes jaypipes left a 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.

Comment on lines 169 to 170
// If terminal condition exists, other errors will
// will not be reported
Copy link
Collaborator

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...

Copy link
Contributor Author

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.

Copy link
Collaborator

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 :)

@jkuruba jkuruba changed the title Adding status reporting for NonTerminalCondition Adding status reporting for RecoverableCondition Apr 7, 2021
Copy link
Collaborator

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

👍 thank you @jkuruba! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants