-
Notifications
You must be signed in to change notification settings - Fork 176
fix: mark resource as adopted #182
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
fix: mark resource as adopted #182
Conversation
5ef92c8
to
909f088
Compare
/test sagemaker-controller-test |
pkg/runtime/reconciler.go
Outdated
if adoptionPolicy == AdoptionPolicy_AdoptOrCreate { | ||
r.rd.MarkAdopted(latest) | ||
} |
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 is a question not a suggestion, what do you think the code below? any edge cases where it wouldn't work?
defer func() {
if adoptionpolicy == adopt || adoptOrCreate {
r.rd.MarkAdopt
}
}
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, mostly errors. If there's an error for any reason, the controller won't attempt to adopt during the next reconciliation.
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.
Also, for adopt-or-create, i'm thinking of removing this portion, and not mark the resource as adopted if we're going to create it..
Ensure resource is marked as adopted after successful adoption
909f088
to
2f65e55
Compare
/test ec2-controller-test |
@michaelhtm: 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. |
/test ec2-controller-test |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: michaelhtm, 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 |
Issue #, if available:
Description of changes:
Ensure resource is marked as adopted after successful adoption
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.