-
Notifications
You must be signed in to change notification settings - Fork 579
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
Add list AMIs command to clusterawsadm #2304
Conversation
The programmatic output doesn't really work if i run
First of all, the header isn't JSON and will break consumers, and then probably don't want the Table output as JSON I'd probably want an array of AMIs, like [
{
"amiID": "ami-0b4a11b337f543a7a",
"name": "capa-ami-amazon-2-1.19.9-00-1616561545",
"creationDate": "2021-03-24T05:01:45.000Z"
"kubernetesVersion": "v1.19.9"
},
...
] Given that the API call is super slow and expensive, it's probably quicker to fetch all AMIs owned by the account, and sort in memory. The output also needs deduping, with duplicate AMIs shown. I would remove the big
header, given that there is a flag that allows the user to filter on the version anyway. Instead, give the user a deduped, sorted list, sorted by: Kubernetes version (descending) |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: randomvariable 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 |
/kind feature
What this PR does / why we need it:
This PR adds a list command to clusterawsadm to list AMIs based on OS, region, and Kubernetes version.
clusterawsadm ami list --kubernetes-version=v1.18.12 --os=ubuntu-20.04 --region=us-west-2
If none of the flags are used (
clusterawsadm ami list
), lists AMIs in all supported regions, OSes, and supported Kubernetes versions (N-2).Example output:
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 #2040
Special notes for your reviewer:
Checklist: