Revert "Move KUBECONFIG into common.sh, change default to new location"

This commit is contained in:
Robert Bailey 2015-04-16 22:17:11 -07:00
parent 508318afc9
commit 723f2941e8
2 changed files with 1 additions and 5 deletions

View File

@ -22,8 +22,6 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
DEFAULT_KUBECONFIG="${HOME}/.kube/config"
# Generate kubeconfig data for the created cluster.
# Assumed vars:
# KUBE_USER
@ -38,7 +36,6 @@ DEFAULT_KUBECONFIG="${HOME}/.kube/config"
function create-kubeconfig() {
local kubectl="${KUBE_ROOT}/cluster/kubectl.sh"
KUBECONFIG=${KUBECONFIG:-$DEFAULT_KUBECONFIG}
# KUBECONFIG determines the file we write to, but it may not exist yet
if [[ ! -e "${KUBECONFIG}" ]]; then
mkdir -p $(dirname "${KUBECONFIG}")
@ -63,7 +60,6 @@ function create-kubeconfig() {
# KUBECONFIG
# CONTEXT
function clear-kubeconfig() {
KUBECONFIG=${KUBECONFIG:-$DEFAULT_KUBECONFIG}
local kubectl="${KUBE_ROOT}/cluster/kubectl.sh"
"${kubectl}" config unset "clusters.${CONTEXT}"
"${kubectl}" config unset "users.${CONTEXT}"
@ -89,7 +85,6 @@ function clear-kubeconfig() {
# KUBE_USER,KUBE_PASSWORD will be empty if no current-context is set, or
# the current-context user does not exist or contain basicauth entries.
function get-kubeconfig-basicauth() {
KUBECONFIG=${KUBECONFIG:-$DEFAULT_KUBECONFIG}
# Templates to safely extract the username,password for the current-context
# user. The long chain of 'with' commands avoids indexing nil if any of the
# entries ("current-context", "contexts"."current-context", "users", etc)

View File

@ -673,6 +673,7 @@ function kube-up {
echo "Kubernetes cluster created."
# TODO use token instead of basic auth
export KUBECONFIG="${HOME}/.kube/.kubeconfig"
export KUBE_CERT="/tmp/kubecfg.crt"
export KUBE_KEY="/tmp/kubecfg.key"
export CA_CERT="/tmp/kubernetes.ca.crt"