Skip to content

feat: Adopt-or-Create #179

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

michaelhtm
Copy link
Member

@michaelhtm michaelhtm commented Apr 4, 2025

Issue #2406

Description of changes:
Allow users to create the resource if adoption fails due to a
NotFound error. With these changes, we are expecting
users to populate all the necessary fields for creation in the
resource spec, and the status fields in the adoption-fields
annotation

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 April 4, 2025 22:58
Copy link

ack-prow bot commented Apr 4, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: michaelhtm
Once this PR has been reviewed and has the lgtm label, please assign a-hilaly for approval by writing /assign @a-hilaly in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@michaelhtm michaelhtm changed the title feat: Adopt-or-Create feature feat: Adopt-or-Create Apr 4, 2025
Allow users to create the resource if adoption fails due to a
`NotFound` error. With these changes, we are expecting users to
populate all the necessary fields for creation in the reosurce
spec, and the status fileds in the `adoption-fields` annotation
@michaelhtm michaelhtm force-pushed the feat/adoptorcreate branch from efde0ab to 2163f84 Compare April 5, 2025 01:14
@gfaraj
Copy link

gfaraj commented Apr 7, 2025

Hi @michaelhtm! Quick question -- will this overwrite the entire Kubernetes manifest if it's able to adopt an existing resource? From the code I'm seeing, it seems like that's the case.

In my case, I would like to avoid that if possible. Overwriting the manifest from the adopted resource means I have to hit "sync" again for my argo app. Really, I just want to upsert my resource to match my ACK spec.

While I think overwriting the whole thing does seem like a valid use case, maybe it's possible to support both cases? Might be looking at a separate adoption policy of "upsert" or something like that?

@michaelhtm
Copy link
Member Author

@gfaraj Hello, The entire manifest would be replaced with the spec defined in AWS if the adoption-policy is adopt. With the current implementation, if it's adopt-or-create, the controller will do an update after the adoption, if not it will create the resource. Maybe we need a better name than adopt-or-create..

@gfaraj
Copy link

gfaraj commented Apr 7, 2025

@michaelhtm oh nice, thanks for confirming that, I may have misread part of the changes. Yeah then this seems more like an "upsert" -- maybe that should be the policy name instead?

@michaelhtm michaelhtm force-pushed the feat/adoptorcreate branch from 2310560 to 8bf6a25 Compare April 8, 2025 22:07
Copy link

ack-prow bot commented Apr 11, 2025

@michaelhtm: The following tests 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 6bb2bdd link false /test verify-attribution
unit-test 6bb2bdd link true /test unit-test
sagemaker-controller-test 6bb2bdd link true /test sagemaker-controller-test

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.

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.

2 participants