Skip to content

Commit

Permalink
Add kdecode_secret
Browse files Browse the repository at this point in the history
  • Loading branch information
GMadorell committed Feb 20, 2023
1 parent 3932a3d commit 7c0efd1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,13 @@ function kchangenamespace() { kubens ; }
function knamespace() { kubens ; }
function kns() { kubens ; }

function kdecode_secret() {
percol_secret_selection=$(kubectl get secret | percol --prompt='<green>Select secret to decode:</green> %q')
local selected_secret=$(echo $percol_secret_selection | cut -d" " -f1)
echo "Selected secret: $selected_secret"
kubectl get secret $selected_secret -o json | jq '.data | map_values(@base64d)'
}

## GIT ALIASES AND HELPER FUNCTIONS
alias gp="git push"
alias gpf="git push --force-with-lease"
Expand Down

0 comments on commit 7c0efd1

Please sign in to comment.