Skip to content
This repository has been archived by the owner on Nov 20, 2021. It is now read-only.

"crit create token" returns no output #15

Open
seaunderwater opened this issue Oct 7, 2020 · 1 comment
Open

"crit create token" returns no output #15

seaunderwater opened this issue Oct 7, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@seaunderwater
Copy link
Contributor

When creating a bootstrap token using crit create token, no output is returned to the user:

$ crit create token
$

This is inconvenient for the following reasons:

  • There is no indication that the command was successful.
  • The user is left to search for the token using kubectl get secrets. This becomes difficult when there are several tokens:
$  kg secrets
NAME                                             TYPE                                  DATA   AGE
...
bootstrap-signer-token-dzqwn                     kubernetes.io/service-account-token   3      161m
bootstrap-token-8459vn                           bootstrap.kubernetes.io/token         6      4m10s
bootstrap-token-drwuzf                           bootstrap.kubernetes.io/token         6      2m14s
bootstrap-token-epw5fz                           bootstrap.kubernetes.io/token         6      31m
bootstrap-token-otgi8h                           bootstrap.kubernetes.io/token         6      2m3s
bootstrap-token-pxsarz                           bootstrap.kubernetes.io/token         6      3m2s
bootstrap-token-vygvaf                           bootstrap.kubernetes.io/token         6      2m11s
...
  • The user has to base64 decode and concatenate <token-id>.<token-secret>:
$ kg secret bootstrap-token-8459vn -o yaml 
apiVersion: v1
data:
  auth-extra-groups: c3lzdGVtOmJvb3RzdHJhcHBlcnM6Y3JpdDpkZWZhdWx0LW5vZGUtdG9rZW4=
  expiration: MjAzMC0xMC0wNVQxOTozODo1M1o=
  token-id: ODQ1OXZu
  token-secret: eXE0azkzZHhkd3Zxaml2cQ==
  usage-bootstrap-authentication: dHJ1ZQ==
  usage-bootstrap-signing: dHJ1ZQ==
kind: Secret
...
@seaunderwater seaunderwater added the enhancement New feature or request label Oct 7, 2020
@ChrisRx
Copy link
Member

ChrisRx commented Oct 7, 2020

In addition to this, both crit create token and crit generate token specific cobra.MinimumNArgs(1). crit create token should instead specify cobra.MaximumNArgs(1) and crit generate token should specify cobra.NoArgs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants