Merge pull request #4369 from jlowdermilk/fix-kube-up

Fix kube-up bug introduced by #4353
pull/6/head
Eric Tune 2015-02-11 20:47:07 -08:00
commit 52bf48cac2
1 changed files with 2 additions and 1 deletions

View File

@ -199,7 +199,8 @@ function detect-master () {
# KUBE_PASSWORD
function get-password {
# go template to extract the auth-path of the current-context user
local template='{{with $ctx := index . "current-context"}}{{$user := index . "contexts" $ctx "user"}}{{index . "users" $user "auth-path"}}{{end}}'
# Note: we save dot ('.') to $dot because the 'with' action overrides dot
local template='{{$dot := .}}{{with $ctx := index $dot "current-context"}}{{$user := index $dot "contexts" $ctx "user"}}{{index $dot "users" $user "auth-path"}}{{end}}'
local file=$("${KUBE_ROOT}/cluster/kubectl.sh" config view -o template --template="${template}")
if [[ ! -z "$file" && -r "$file" ]]; then
KUBE_USER=$(cat "$file" | python -c 'import json,sys;print json.load(sys.stdin)["User"]')