-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Get launch template versions after filtering templates #9909
Conversation
/assign |
if strings.HasPrefix(aws.StringValue(x.LaunchTemplateName), prefix) { | ||
err := func() error { | ||
for { | ||
resp, err := cloud.EC2().DescribeLaunchTemplateVersions(&ec2.DescribeLaunchTemplateVersionsInput{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI it looks like we could also use DescribeLaunchTemplateVersionsPages - that can be a separate PR though
list = append(list, resp.LaunchTemplateVersions...) | ||
if resp.NextToken == nil { | ||
return nil | ||
if strings.HasPrefix(aws.StringValue(x.LaunchTemplateName), prefix) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally out of scope for this PR, but apparently filters can also support wildcards, e.g. fmt.Sprintf("%s-*", name)
. I certainly didn't know that - so it wouldn't surprise me if we had multiple places where we could pre-filter by prefix.
Source: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html#Filtering_Resources_CLI
LGTM - will approve but hold for other reviewers. Feel free to hold cancel after a few hours! /approve |
/hold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: johngmyers, justinsb 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 |
/hold cancel |
…09-upstream-release-1.18 Automated cherry pick of #9909: Get launch template versions after filtering templates
…09-upstream-release-1.17 Automated cherry pick of #9909: Get launch template versions after filtering templates
…ick-of-#9909-upstream-release-1.17 Automated cherry pick of kubernetes#9909: Get launch template versions after filtering templates
…ick-of-#9909-upstream-release-1.17 Automated cherry pick of kubernetes#9909: Get launch template versions after filtering templates
…ick-of-#9909-upstream-release-1.17 Automated cherry pick of kubernetes#9909: Get launch template versions after filtering templates
Should at least partially remediate #9806 by filtering the launch templates before enumerating their versions.