Skip to content

fix: key LaunchTemplate by Name so adopt-or-create works - #347

Open
michaelhtm wants to merge 1 commit into
aws-controllers-k8s:mainfrom
michaelhtm:fix/launch-template-adopt-by-name
Open

fix: key LaunchTemplate by Name so adopt-or-create works#347
michaelhtm wants to merge 1 commit into
aws-controllers-k8s:mainfrom
michaelhtm:fix/launch-template-adopt-by-name

Conversation

@michaelhtm

Copy link
Copy Markdown
Member

Description of changes:
LaunchTemplate was keyed by Status.ID, so sdkFind short-circuited to
NotFound whenever the ID was unset and adopt-or-create looped on
CreateLaunchTemplate AlreadyExistsException. Make the unique Name the
primary key (immutable, since AWS cannot rename templates) so sdkFind
reads by name and adopts a pre-existing template. Also stop
DescribeLaunchTemplateVersions from running unfiltered when the template
identifier is unknown, which would clobber Spec.Data with unrelated data.

Resolves aws-controllers-k8s/community#2932

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 gustavodiaz7722 and knottnt June 24, 2026 18:25
@ack-prow

ack-prow Bot commented Jun 24, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: michaelhtm

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 added the approved label Jun 24, 2026
@michaelhtm
michaelhtm force-pushed the fix/launch-template-adopt-by-name branch from 3a993ca to 3a36dae Compare June 24, 2026 20:31
@michaelhtm

Copy link
Copy Markdown
Member Author

/retest

@michaelhtm
michaelhtm force-pushed the fix/launch-template-adopt-by-name branch from 3a36dae to 9845060 Compare June 25, 2026 16:46
@michaelhtm

Copy link
Copy Markdown
Member Author

/label release/patch

@ack-prow ack-prow Bot added the release/patch Indicates this PR should trigger a patch version release on merge. label Jun 25, 2026
LaunchTemplate was keyed by Status.ID, so sdkFind short-circuited to
NotFound whenever the ID was unset and adopt-or-create looped on
CreateLaunchTemplate AlreadyExistsException. Make the unique Name the
primary key (immutable, since AWS cannot rename templates) so sdkFind
reads by name and adopts a pre-existing template. Also stop
DescribeLaunchTemplateVersions from running unfiltered when the template
identifier is unknown, which would clobber Spec.Data with unrelated data.

Resolves aws-controllers-k8s/community#2932
@michaelhtm
michaelhtm force-pushed the fix/launch-template-adopt-by-name branch from 9845060 to 53de950 Compare June 25, 2026 20:19
@michaelhtm

Copy link
Copy Markdown
Member Author

/retest

@michaelhtm

Copy link
Copy Markdown
Member Author

/label release/patch

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

Labels

approved release/patch Indicates this PR should trigger a patch version release on merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ec2-controller] LaunchTemplate adopt-or-create silently fails with AlreadyExistsException when Status.ID is unset

1 participant