Skip to content
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: handle LaunchTemplateNameNotFound error #2410

Conversation

dkoshkin
Copy link
Contributor

@dkoshkin dkoshkin commented May 18, 2021

What type of PR is this?

What this PR does / why we need it:
This function will return a 400 with an error like InvalidLaunchTemplateName.NotFoundException: The specified launch template, with template name foo, does not exist.

out, err := s.EC2Client.DescribeLaunchTemplateVersions(input)

Added a new LaunchTemplateNameNotFound in the IsInvalidNotFoundError() function and updated the unit tests to reflect what the AWS API returns.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2402

Special notes for your reviewer:
Also tested with a dev image docker.io/dkoshkin/cluster-api-aws-controller-amd64:LaunchTemplateNameNotFound

➜ kubectl get clusters,awsclusters,machinepools,awsmachinepools
NAME                                                       PHASE
cluster.cluster.x-k8s.io/dkoshkin-launchtemplatenotfound   Provisioned

NAME                                                                         CLUSTER                           READY   VPC                     BASTION IP
awscluster.infrastructure.cluster.x-k8s.io/dkoshkin-launchtemplatenotfound   dkoshkin-launchtemplatenotfound   true    vpc-0fe0999d43337350d

NAME                                                                    REPLICAS   PHASE     VERSION
machinepool.exp.cluster.x-k8s.io/dkoshkin-launchtemplatenotfound-mp-0   1          Running   1.20.6

NAME                                                                                  READY   REPLICAS   MINSIZE   MAXSIZE   LAUNCHTEMPLATE ID
awsmachinepool.infrastructure.cluster.x-k8s.io/dkoshkin-launchtemplatenotfound-mp-0   true    1          1         2         lt-0a2024ddf6e00cfbd

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Release note:

Fix for reconciling LaunchTemplates.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 18, 2021
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 18, 2021
@dkoshkin
Copy link
Contributor Author

I opened the PR against release-0.6 but the bug also exists in main, I'm guessing I should open a PR against main too?

What about release-0.7 I noticed that the original fix was not merged there?

@sedefsavas
Copy link
Contributor

Thanks for the fix @dkoshkin.

release-0.7 can be ignored as we don't have a v0.7.x release yet, all v1alpha4 changes are under main branch until we cut a release.
The ordering cluster-api follows for cherry-picks are: we merge the change to main first, then we cherry-pick to release-0.6.

@dkoshkin
Copy link
Contributor Author

The ordering cluster-api follows for cherry-picks are: we merge the change to main first, then we cherry-pick to release-0.6.

Thank you for the quick response, will open a PR against main now.

@sedefsavas
Copy link
Contributor

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sedefsavas

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 18, 2021
@k8s-ci-robot k8s-ci-robot merged commit 4ca623b into kubernetes-sigs:release-0.6 May 18, 2021
richardchen-db pushed a commit to databricks/cluster-api-provider-aws-1 that referenced this pull request Jan 14, 2023
…-notfound-0.6

fix: handle LaunchTemplateNameNotFound error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants