-
-
Save shendongming/96ffd00a129fb51b8c11b6d5d60bde6b to your computer and use it in GitHub Desktop.
helm-tls alias
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function helm-tls() { | |
flag="" | |
if [[ "$1" == "delete" ]] || [[ "$1" == "diff" ]] || [[ "$1" == "get" ]] || [[ "$1" == "history" ]] || [[ "$1" == "install" ]] || [[ "$1" == "list" ]] || [[ "$1" == "reset" ]] || [[ "$1" == "rollback" ]] || [[ "$1" == "status" ]] || [[ "$1" == "test" ]] || [[ "$1" == "upgrade" ]] || [[ "$1" == "version" ]]; then | |
flag="--tls" | |
fi | |
helm ${1+"$@"} $flag | |
} | |
unalias helm | |
alias helm=helm-tls | |
# GET --tls flags | |
function export_new_condtion() { | |
helm help | grep 'Available Commands' -A 28 | tail -n 28 | awk '{print "helm " $1 " --help | grep '\''\\-\\-tls'\'' | wc -l " }' | sh -x &>step1.out | |
cat step1.out | grep -E '\-\-help|[0-9]' | grep 6 -B 1 >step2.out | |
cat step2.out | grep '+ helm' | awk 'BEGIN{ORS=" "}{print p "[[ \"$1\" == \"" $3 "\" ]]" ; p=" || " }' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment