kubectl-view-secret icon indicating copy to clipboard operation
kubectl-view-secret copied to clipboard

use escape characters while printing secret values

Open o-c-e opened this issue 3 years ago • 2 comments

Command kubectl view-secret secret-name -a prints the secret keys and their values per line, delimited by = which makes it shell compatible but not always

so secret keys with multiline values or special characters are printed as is, which makes it impossible to always run source <(kubectl view-secret cluster-configs -a)

escaping will bring us the advantage of directly declaring them in shell as well

o-c-e avatar Aug 23 '22 16:08 o-c-e

@elsesiy I'd very much like to raise a PR for this if u approve!

PS: Thank you for such a handy easy to use kubectl plugin

o-c-e avatar Aug 23 '22 16:08 o-c-e

@opencloudengineer Thanks for filing this issue. I gave it some thought but I don't think there's a simple fix here, there's many different shells (POSIX, bash, zsh, fish, etc.) and all of them could have slight variations in which characters require escaping and the escape sequence to be used. What approach were you thinking to implement?

elsesiy avatar Sep 05 '22 04:09 elsesiy

Closing due to inactivity

elsesiy avatar Jan 08 '23 16:01 elsesiy