Skip to content

Conversation

@gauravgahlot
Copy link
Contributor

@gauravgahlot gauravgahlot commented Dec 24, 2020

Description

The PR introduces a new flag --quiet or -q to only display template IDs.

/ # tink template list -h
list all saved templates

Usage:
  tink template list [flags]

Examples:
tink template list

Flags:
  -h, --help    help for list
  -q, --quiet   only display template IDs

Global Flags:
  -f, --facility string   used to build grpc and http urls

/ # tink template list
+--------------------------------------+---------------+-------------------------------+-------------------------------+
| TEMPLATE ID                          | TEMPLATE NAME | CREATED AT                    | UPDATED AT                    |
+--------------------------------------+---------------+-------------------------------+-------------------------------+
| 7d387260-4520-11eb-b30b-0242ac130004 | disk-wipe     | 2020-12-23 13:12:20 +0000 UTC | 2020-12-23 13:12:20 +0000 UTC |
| 84939840-4520-11eb-b30b-0242ac130004 | ubuntu        | 2020-12-23 13:12:33 +0000 UTC | 2020-12-23 13:12:33 +0000 UTC |
| 858c76c1-4520-11eb-b30b-0242ac130004 | debian        | 2020-12-23 13:12:34 +0000 UTC | 2020-12-23 13:12:34 +0000 UTC |
+--------------------------------------+---------------+-------------------------------+-------------------------------+

/ # tink template list -q
7d387260-4520-11eb-b30b-0242ac130004
84939840-4520-11eb-b30b-0242ac130004
858c76c1-4520-11eb-b30b-0242ac130004

Why is this needed

This will definitely help when users need to migrate templates or do some automation that only requires the template IDs.
For example, delete all templates:

/ # tink template delete $(tink template list -q)

How Has This Been Tested?

Tested manually over the vagrant setup.

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>
@gauravgahlot gauravgahlot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 24, 2020
@gauravgahlot gauravgahlot self-assigned this Dec 24, 2020
@gauravgahlot gauravgahlot requested a review from Cbkhare December 24, 2020 04:28
@codecov
Copy link

codecov bot commented Dec 24, 2020

Codecov Report

Merging #402 (cd54c41) into master (a04ccb4) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #402   +/-   ##
=======================================
  Coverage   20.82%   20.82%           
=======================================
  Files          24       24           
  Lines        2170     2170           
=======================================
  Hits          452      452           
  Misses       1678     1678           
  Partials       40       40           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a04ccb4...cd54c41. Read the comment docs.

@Cbkhare Cbkhare merged commit 06519be into tinkerbell:master Dec 24, 2020
@gauravgahlot gauravgahlot deleted the template-list-quiet branch December 24, 2020 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants