Skip to content
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

Merged
merged 3 commits into from
Apr 9, 2021

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
templates/pkg/resource/sdk.go.tpl Outdated Show resolved Hide resolved
templates/pkg/resource/sdk.go.tpl Outdated Show resolved Hide resolved
templates/pkg/resource/sdk.go.tpl Show resolved Hide resolved
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