Skip to content

Conversation

michaelhtm
Copy link
Member

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.

@ack-prow ack-prow bot requested review from a-hilaly and jlbutler May 7, 2025 19:18
@michaelhtm michaelhtm force-pushed the fix/markresourceasadopted branch from 5ef92c8 to 909f088 Compare May 7, 2025 19:25
@michaelhtm
Copy link
Member Author

/test sagemaker-controller-test

Comment on lines 478 to 480
if adoptionPolicy == AdoptionPolicy_AdoptOrCreate {
r.rd.MarkAdopted(latest)
}
Copy link
Member

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

Copy link
Member Author

@michaelhtm michaelhtm May 7, 2025

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.

Copy link
Member Author

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
@michaelhtm michaelhtm force-pushed the fix/markresourceasadopted branch from 909f088 to 2f65e55 Compare May 8, 2025 20:05
@michaelhtm
Copy link
Member Author

/test ec2-controller-test

Copy link

ack-prow bot commented May 9, 2025

@michaelhtm: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
verify-attribution 2f65e55 link false /test verify-attribution

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.

@michaelhtm
Copy link
Member Author

/test ec2-controller-test

@rushmash91
Copy link
Member

/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label May 12, 2025
Copy link

ack-prow bot commented May 12, 2025

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow bot merged commit ed02643 into aws-controllers-k8s:main May 12, 2025
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants