Move storage of password

pull/6/head
Daniel Smith 2014-06-11 16:57:47 -07:00
parent 59d9763a52
commit 88b9c7ba79
2 changed files with 10 additions and 8 deletions

View File

@ -46,15 +46,8 @@ KUBE_TEMP=$(mktemp -d -t kubernetes.XXXXXX)
trap "rm -rf ${KUBE_TEMP}" EXIT
get-password
echo "Generating password: $user:$passwd"
echo "Using password: $user:$passwd"
htpasswd -b -c ${KUBE_TEMP}/htpasswd $user $passwd
cat << EOF > ~/.kubernetes_auth
{
"User": "$user",
"Password": "$passwd"
}
EOF
chmod 0600 ~/.kubernetes_auth
HTPASSWD=$(cat ${KUBE_TEMP}/htpasswd)
(

View File

@ -89,5 +89,14 @@ function get-password {
fi
user=admin
passwd=$(python -c 'import string,random; print "".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(16))')
# Store password for reuse.
cat << EOF > ~/.kubernetes_auth
{
"User": "$user",
"Password": "$passwd"
}
EOF
chmod 0600 ~/.kubernetes_auth
}