make klogs a workable command which logs amonst k8s applicaiton

This commit is contained in:
hophacker 2020-02-27 21:27:57 +08:00
parent 051ab834ef
commit e2baa7ef69

View File

@ -388,19 +388,26 @@ function kexec {
fi
}
function k_logs {
CONTEXT=gcloud
while getopts ":c:p:" opt; do
case "${opt}" in
c)
CONTEXT=$OPTARG
function klogs {
KCONTEXT=${KCONTEXT:-gcloud}
finalopts=()
while [[ $@ != "" ]] do
case $1 in
-c)
KCONTEXT="$2"
shift; shift
;;
p)
PROJECT=$OPTARG
--context=*)
KCONTEXT="${i#*=}"
shift
;;
-p)
PROJECT="$2"
shift; shift
;;
*)
echo "Usage: cmd [-h]"
return
finalopts+=($1)
shift
;;
esac
done