Skip to content

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

@cmoulliard

Description

@cmoulliard

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions