Skip to content

🐛 Launchtemplate needs to be updated if spot options are changed #5496

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 1 commit into
base: main
Choose a base branch
from

Conversation

fiunchinho
Copy link
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

When the spot instances options are changed, we want to update the launch template so that the changes take effect.

Special notes for your reviewer:

I've changed the unit tests for the LaunchTemplateNeedsUpdate function, because some cases were passing by pure chance. Basically these security groups are always added to the incoming AWSLaunchTemplate

{ID: aws.String("sg-111")},
{ID: aws.String("sg-222")},

So if the existing AWSLaunchTemplate that we use in the tests don't have these security groups, the function will always return true. Tests like the one testing changes to the IamInstanceProfile field were passing because of the different security groups, rather than the change on the IamInstanceProfile field.

Checklist:

  • squashed commits
  • includes documentation
  • includes emoji in title
  • adds unit tests
  • adds or updates e2e tests

Release note:

LaunchTemplate needs to be updated if spot options are changed

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 15, 2025
@k8s-ci-robot k8s-ci-robot requested a review from dlipovetsky May 15, 2025 13:24
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign dlipovetsky for approval. For more information see the 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

@k8s-ci-robot k8s-ci-robot requested a review from faiq May 15, 2025 13:24
@fiunchinho
Copy link
Contributor Author

/test pull-cluster-api-provider-aws-e2e
/test pull-cluster-api-provider-aws-e2e-eks

Copy link
Contributor

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 16, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: d778b6d36ce012772b2bb23779e7a386fca21354

@fiunchinho fiunchinho force-pushed the fix-launchtemplate-needs-update branch from 99f00ed to 4a57ee5 Compare May 18, 2025 16:51
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 18, 2025
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 18, 2025
@fiunchinho fiunchinho force-pushed the fix-launchtemplate-needs-update branch 2 times, most recently from 6f3953d to e0d5e11 Compare May 19, 2025 13:23
@fiunchinho fiunchinho force-pushed the fix-launchtemplate-needs-update branch from e0d5e11 to 99c1047 Compare May 19, 2025 13:25
@fiunchinho
Copy link
Contributor Author

/test pull-cluster-api-provider-aws-e2e
/test pull-cluster-api-provider-aws-e2e-eks

@fiunchinho
Copy link
Contributor Author

@alexander-demicev After testing the changes in our management cluster, I needed to do more changes to make this work. PTAL, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. needs-priority release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants