mirror of https://github.com/k3s-io/k3s
set KUBECONFIG in common.sh, default to new location
and preserve value in ginkgo e2e test driverpull/6/head
parent
08f17bfa70
commit
3787fc5eca
|
@ -605,7 +605,6 @@ function kube-up {
|
|||
echo "Kubernetes cluster created."
|
||||
|
||||
# TODO use token instead of kube_auth
|
||||
export KUBECONFIG="${KUBECONFIG:-${HOME}/.kube/.kubeconfig}"
|
||||
export KUBE_CERT="/tmp/$RANDOM-kubecfg.crt"
|
||||
export KUBE_KEY="/tmp/$RANDOM-kubecfg.key"
|
||||
export CA_CERT="/tmp/$RANDOM-kubernetes.ca.crt"
|
||||
|
|
|
@ -420,7 +420,6 @@ function kube-up {
|
|||
printf "\n"
|
||||
echo "Kubernetes cluster created."
|
||||
|
||||
export KUBECONFIG="${KUBECONFIG:-${HOME}/.kube/.kubeconfig}"
|
||||
export KUBE_CERT="/tmp/$RANDOM-kubecfg.crt"
|
||||
export KUBE_KEY="/tmp/$RANDOM-kubecfg.key"
|
||||
export CA_CERT="/tmp/$RANDOM-kubernetes.ca.crt"
|
||||
|
|
|
@ -237,7 +237,6 @@ function kube-up {
|
|||
rm $domain_xml
|
||||
done
|
||||
|
||||
export KUBECONFIG="${KUBECONFIG:-${HOME}/.kube/.kubeconfig}"
|
||||
export KUBE_SERVER="http://192.168.10.1:8080"
|
||||
export CONTEXT="libvirt-coreos"
|
||||
create-kubeconfig
|
||||
|
|
|
@ -318,7 +318,6 @@ kube-up() {
|
|||
|
||||
echo "Kubernetes cluster created."
|
||||
|
||||
export KUBECONFIG="${KUBECONFIG-${HOME}/.kube/.kubeconfig}"
|
||||
export KUBE_CERT=""
|
||||
export KUBE_KEY=""
|
||||
export CA_CERT=""
|
||||
|
|
|
@ -253,7 +253,6 @@ function kube-up {
|
|||
|
||||
vagrant up
|
||||
|
||||
export KUBECONFIG="${KUBECONFIG:-${HOME}/.kube/.kubeconfig}"
|
||||
export KUBE_CERT="/tmp/$RANDOM-kubecfg.crt"
|
||||
export KUBE_KEY="/tmp/$RANDOM-kubecfg.key"
|
||||
export CA_CERT="/tmp/$RANDOM-kubernetes.ca.crt"
|
||||
|
|
|
@ -364,7 +364,6 @@ function kube-up {
|
|||
echo "Kubernetes cluster created."
|
||||
|
||||
# TODO use token instead of basic auth
|
||||
export KUBECONFIG="${KUBECONFIG:-"${HOME}/.kube/.kubeconfig"}"
|
||||
export KUBE_CERT="/tmp/$RANDOM-kubecfg.crt"
|
||||
export KUBE_KEY="/tmp/$RANDOM-kubecfg.key"
|
||||
export CA_CERT="/tmp/$RANDOM-kubernetes.ca.crt"
|
||||
|
|
|
@ -87,15 +87,7 @@ if [[ -z "${AUTH_CONFIG:-}" ]]; then
|
|||
|
||||
detect-master >/dev/null
|
||||
|
||||
|
||||
if [[ "$KUBERNETES_PROVIDER" == "vagrant" ]]; then
|
||||
# When we are using vagrant it has hard coded auth. We repeat that here so that
|
||||
# we don't clobber auth that might be used for a publicly facing cluster.
|
||||
auth_config=(
|
||||
"--auth_config=${HOME}/.kubernetes_vagrant_auth"
|
||||
"--kubeconfig=${HOME}/.kubernetes_vagrant_kubeconfig"
|
||||
)
|
||||
elif [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then
|
||||
if [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then
|
||||
# GKE stores its own kubeconfig in gcloud's config directory.
|
||||
detect-project &> /dev/null
|
||||
auth_config=(
|
||||
|
@ -103,25 +95,15 @@ if [[ -z "${AUTH_CONFIG:-}" ]]; then
|
|||
# gcloud doesn't set the current-context, so we have to set it
|
||||
"--context=gke_${PROJECT}_${ZONE}_${CLUSTER_NAME}"
|
||||
)
|
||||
elif [[ "${KUBERNETES_PROVIDER}" == "gce" ]]; then
|
||||
auth_config=(
|
||||
"--kubeconfig=${KUBECONFIG:-$DEFAULT_KUBECONFIG}"
|
||||
)
|
||||
elif [[ "${KUBERNETES_PROVIDER}" == "aws" ]]; then
|
||||
auth_config=(
|
||||
"--auth_config=${HOME}/.kube/${INSTANCE_PREFIX}/kubernetes_auth"
|
||||
)
|
||||
elif [[ "${KUBERNETES_PROVIDER}" == "libvirt-coreos" ]]; then
|
||||
auth_config=(
|
||||
"--kubeconfig=${HOME}/.kube/.kubeconfig"
|
||||
)
|
||||
elif [[ "${KUBERNETES_PROVIDER}" == "conformance_test" ]]; then
|
||||
auth_config=(
|
||||
"--auth_config=${KUBERNETES_CONFORMANCE_TEST_AUTH_CONFIG:-}"
|
||||
"--cert_dir=${KUBERNETES_CONFORMANCE_TEST_CERT_DIR:-}"
|
||||
)
|
||||
else
|
||||
auth_config=()
|
||||
auth_config=(
|
||||
"--kubeconfig=${KUBECONFIG:-$DEFAULT_KUBECONFIG}"
|
||||
)
|
||||
fi
|
||||
else
|
||||
echo "Conformance Test. No cloud-provider-specific preparation."
|
||||
|
|
Loading…
Reference in New Issue