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

[Suggestion] Enhance how we print the secret to show them using as format: Table, Yaml or JSON #463

Closed
cmoulliard opened this issue Dec 19, 2024 · 1 comment

Comments

@cmoulliard
Copy link
Contributor

Suggestion

Enhance how we print the secret (based on the kubernetes cli-runtime libe - see: https://github.com/kubernetes/cli-runtime/blob/master/pkg/printers/tableprinter.go#L80C6-L80C21) as we did for the Clusters to show them using as format: Table, Yaml or JSON

Examples

// Yaml
❯ ./idpbuilder get secrets -o yaml
- name: argocd-initial-admin-secret
  namespace: argocd
  password: bQ3e6Ja6uFRTWpXs
  token: ""
  username: admin
- name: gitea-credential
  namespace: gitea
  password: Pp}a:7,9ao'^K42>,<^8o4$9eC501e4p,Spmn;*j
  token: 72c0cbd8ea8c6006a3be970293276d0fe17efcea
  username: giteaAdmin


// Json
❯ ./idpbuilder get secrets -o json
[
  {
    "name": "argocd-initial-admin-secret",
    "namespace": "argocd",
    "username": "admin",
    "password": "bQ3e6Ja6uFRTWpXs",
    "token": ""
  },
  {
    "name": "gitea-credential",
    "namespace": "gitea",
    "username": "giteaAdmin",
    "password": "Pp}a:7,9ao'^K42>,<^8o4$9eC501e4p,Spmn;*j",
    "token": "72c0cbd8ea8c6006a3be970293276d0fe17efcea"
  }
]


// Table
❯ ./idpbuilder get secrets 
NAME                          NAMESPACE   USERNAME     PASSWORD                                   TOKEN
argocd-initial-admin-secret   argocd      admin        bQ3e6Ja6uFRTWpXs                           
gitea-credential              gitea       giteaAdmin   Pp}a:7,9ao'^K42>,<^8o4$9eC501e4p,Spmn;*j   72c0cbd8ea8c6006a3be970293276d0fe17efcea

cmoulliard added a commit to ch007m/fork-idpbuilder that referenced this issue Dec 19, 2024
cmoulliard added a commit to ch007m/fork-idpbuilder that referenced this issue Dec 19, 2024
@cmoulliard
Copy link
Contributor Author

PR merged. So we can close it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant