Add generic master detector; simplify conformance.

Add detect-master-from-kubeconfig bash function.
Use it to no longer require conformance test user
to specify KUBE_MASTER_IP.
This commit is contained in:
Eric Tune
2015-08-12 22:19:29 -07:00
parent ed36bfa860
commit 29da889bbf
3 changed files with 32 additions and 5 deletions

View File

@@ -23,8 +23,6 @@
# cluster to be tested, and with suitable auth setting.
# - Specify the location of that kubeconfig with, e.g.:
# declare -x KUBECONFIG="$HOME/.kube/config"
# - Specify the location of the master with, e.g.:
# declare -x KUBE_MASTER_IP="1.2.3.4"
# - Make sure only essential pods are running and there are no failed/pending pods.
# - Go to a git tree that contains the kubernetes source.
# - git clone git://github.com/kubernetes/kubernetes.git
@@ -65,8 +63,7 @@
: ${KUBECONFIG:?"Must set KUBECONFIG before running conformance test."}
: ${KUBE_MASTER_IP:?"Must set KUBE_MASTER_IP before running conformance test."}
echo "Conformance test using ${KUBECONFIG} against master at ${KUBE_MASTER_IP}"
echo "Conformance test using current-context of ${KUBECONFIG}"
echo -n "Conformance test run date:"
date
echo -n "Conformance test SHA:"

View File

@@ -45,6 +45,9 @@ source "${KUBE_ROOT}/cluster/kube-env.sh"
if [[ -n "${KUBERNETES_CONFORMANCE_TEST:-}" ]]; then
echo "Conformance test: not doing test setup."
KUBERNETES_PROVIDER=""
detect-master-from-kubeconfig
auth_config=(
"--kubeconfig=${KUBECONFIG}"
)
@@ -56,6 +59,7 @@ else
prepare-e2e
detect-master >/dev/null
KUBE_MASTER_URL="${KUBE_MASTER_URL:-https://${KUBE_MASTER_IP:-}}"
auth_config=(
"--kubeconfig=${KUBECONFIG:-$DEFAULT_KUBECONFIG}"
@@ -89,7 +93,7 @@ fi
export PATH=$(dirname "${e2e_test}"):"${PATH}"
"${ginkgo}" "${ginkgo_args[@]:+${ginkgo_args[@]}}" "${e2e_test}" -- \
"${auth_config[@]:+${auth_config[@]}}" \
--host="https://${KUBE_MASTER_IP:-}" \
--host="${KUBE_MASTER_URL}" \
--provider="${KUBERNETES_PROVIDER}" \
--gce-project="${PROJECT:-}" \
--gce-zone="${ZONE:-}" \