diff --git a/cluster/test-network.sh b/cluster/test-network.sh index 0480e137eb6..df456caead7 100755 --- a/cluster/test-network.sh +++ b/cluster/test-network.sh @@ -19,7 +19,5 @@ set -o nounset set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. -source "${KUBE_ROOT}/cluster/kube-env.sh" -source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh" -${KUBE_ROOT}/hack/e2e-suite/goe2e.sh -tTestNetwork +exec "${KUBE_ROOT}/hack/e2e-suite/goe2e.sh" -t TestNetwork diff --git a/hack/e2e-suite/certs.sh b/hack/e2e-suite/certs.sh index 782e4ff7099..fb1574be20d 100755 --- a/hack/e2e-suite/certs.sh +++ b/hack/e2e-suite/certs.sh @@ -22,8 +22,17 @@ set -o nounset set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. + +: ${KUBE_VERSION_ROOT:=${KUBE_ROOT}} +: ${KUBECTL:="${KUBE_VERSION_ROOT}/cluster/kubectl.sh"} +: ${KUBE_CONFIG_FILE:="config-test.sh"} + +export KUBECTL KUBE_CONFIG_FILE + source "${KUBE_ROOT}/cluster/kube-env.sh" -source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh" +source "${KUBE_VERSION_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh" + +prepare-e2e if [[ "${KUBERNETES_PROVIDER}" != "gce" ]] && [[ "${KUBERNETES_PROVIDER}" != "gke" ]]; then echo "WARNING: Skipping certs.sh for cloud provider: ${KUBERNETES_PROVIDER}." diff --git a/hack/e2e-suite/goe2e.sh b/hack/e2e-suite/goe2e.sh index b2938637aa7..daffe8830c1 100755 --- a/hack/e2e-suite/goe2e.sh +++ b/hack/e2e-suite/goe2e.sh @@ -14,11 +14,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. -source "${KUBE_ROOT}/cluster/kube-env.sh" -source "${KUBE_ROOT}/cluster/$KUBERNETES_PROVIDER/util.sh" +set -o errexit +set -o nounset +set -o pipefail -detect-master > /dev/null +KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. + +: ${KUBE_VERSION_ROOT:=${KUBE_ROOT}} +: ${KUBECTL:="${KUBE_VERSION_ROOT}/cluster/kubectl.sh"} +: ${KUBE_CONFIG_FILE:="config-test.sh"} + +export KUBECTL KUBE_CONFIG_FILE + +source "${KUBE_ROOT}/cluster/kube-env.sh" +source "${KUBE_VERSION_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh" + +prepare-e2e + +detect-master >/dev/null # Detect the OS name/arch so that we can find our binary case "$(uname -s)" in diff --git a/hack/e2e-suite/guestbook.sh b/hack/e2e-suite/guestbook.sh index 8b348b36fe2..274194fc373 100755 --- a/hack/e2e-suite/guestbook.sh +++ b/hack/e2e-suite/guestbook.sh @@ -23,8 +23,17 @@ set -o nounset set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. + +: ${KUBE_VERSION_ROOT:=${KUBE_ROOT}} +: ${KUBECTL:="${KUBE_VERSION_ROOT}/cluster/kubectl.sh"} +: ${KUBE_CONFIG_FILE:="config-test.sh"} + +export KUBECTL KUBE_CONFIG_FILE + source "${KUBE_ROOT}/cluster/kube-env.sh" -source "${KUBE_ROOT}/cluster/$KUBERNETES_PROVIDER/util.sh" +source "${KUBE_VERSION_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh" + +prepare-e2e GUESTBOOK="${KUBE_ROOT}/examples/guestbook" diff --git a/hack/e2e-suite/liveness.sh b/hack/e2e-suite/liveness.sh index 7178430289f..cb78dfe6364 100755 --- a/hack/e2e-suite/liveness.sh +++ b/hack/e2e-suite/liveness.sh @@ -22,8 +22,17 @@ set -o nounset set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. + +: ${KUBE_VERSION_ROOT:=${KUBE_ROOT}} +: ${KUBECTL:="${KUBE_VERSION_ROOT}/cluster/kubectl.sh"} +: ${KUBE_CONFIG_FILE:="config-test.sh"} + +export KUBECTL KUBE_CONFIG_FILE + source "${KUBE_ROOT}/cluster/kube-env.sh" -source "${KUBE_ROOT}/cluster/$KUBERNETES_PROVIDER/util.sh" +source "${KUBE_VERSION_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh" + +prepare-e2e liveness_tests="http exec" if [[ ${KUBERNETES_PROVIDER} == "gke" ]]; then diff --git a/hack/e2e-suite/monitoring.sh b/hack/e2e-suite/monitoring.sh index 78df2d8a67d..d999af4fda3 100755 --- a/hack/e2e-suite/monitoring.sh +++ b/hack/e2e-suite/monitoring.sh @@ -23,8 +23,17 @@ set -o nounset set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. + +: ${KUBE_VERSION_ROOT:=${KUBE_ROOT}} +: ${KUBECTL:="${KUBE_VERSION_ROOT}/cluster/kubectl.sh"} +: ${KUBE_CONFIG_FILE:="config-test.sh"} + +export KUBECTL KUBE_CONFIG_FILE + source "${KUBE_ROOT}/cluster/kube-env.sh" -source "${KUBE_ROOT}/cluster/$KUBERNETES_PROVIDER/util.sh" +source "${KUBE_VERSION_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh" + +prepare-e2e MONITORING="${KUBE_ROOT}/cluster/addons/cluster-monitoring" KUBECTL="${KUBE_ROOT}/cluster/kubectl.sh" diff --git a/hack/e2e-suite/pd.sh b/hack/e2e-suite/pd.sh index 673e69d2fe4..2910023021a 100755 --- a/hack/e2e-suite/pd.sh +++ b/hack/e2e-suite/pd.sh @@ -22,8 +22,17 @@ set -o nounset set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. + +: ${KUBE_VERSION_ROOT:=${KUBE_ROOT}} +: ${KUBECTL:="${KUBE_VERSION_ROOT}/cluster/kubectl.sh"} +: ${KUBE_CONFIG_FILE:="config-test.sh"} + +export KUBECTL KUBE_CONFIG_FILE + source "${KUBE_ROOT}/cluster/kube-env.sh" -source "${KUBE_ROOT}/cluster/$KUBERNETES_PROVIDER/util.sh" +source "${KUBE_VERSION_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh" + +prepare-e2e if [[ "$KUBERNETES_PROVIDER" != "gce" ]] && [[ "$KUBERNETES_PROVIDER" != "gke" ]]; then echo "WARNING: Skipping pd.sh for cloud provider: ${KUBERNETES_PROVIDER}." diff --git a/hack/e2e-suite/services.sh b/hack/e2e-suite/services.sh index ed8926e51d3..a8b4ec9d031 100755 --- a/hack/e2e-suite/services.sh +++ b/hack/e2e-suite/services.sh @@ -21,8 +21,17 @@ set -o nounset set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. + +: ${KUBE_VERSION_ROOT:=${KUBE_ROOT}} +: ${KUBECTL:="${KUBE_VERSION_ROOT}/cluster/kubectl.sh"} +: ${KUBE_CONFIG_FILE:="config-test.sh"} + +export KUBECTL KUBE_CONFIG_FILE + source "${KUBE_ROOT}/cluster/kube-env.sh" -source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh" +source "${KUBE_VERSION_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh" + +prepare-e2e if [[ "$KUBERNETES_PROVIDER" == "vagrant" ]]; then echo "WARNING: Skipping services.sh for ${KUBERNETES_PROVIDER}. See https://github.com/GoogleCloudPlatform/kubernetes/issues/3655" diff --git a/hack/e2e-suite/update.sh b/hack/e2e-suite/update.sh index 6ddc1ab32e8..c147492e48c 100755 --- a/hack/e2e-suite/update.sh +++ b/hack/e2e-suite/update.sh @@ -21,9 +21,17 @@ set -o nounset set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. -source "${KUBE_ROOT}/cluster/kube-env.sh" -source "${KUBE_ROOT}/cluster/$KUBERNETES_PROVIDER/util.sh" +: ${KUBE_VERSION_ROOT:=${KUBE_ROOT}} +: ${KUBECTL:="${KUBE_VERSION_ROOT}/cluster/kubectl.sh"} +: ${KUBE_CONFIG_FILE:="config-test.sh"} + +export KUBECTL KUBE_CONFIG_FILE + +source "${KUBE_ROOT}/cluster/kube-env.sh" +source "${KUBE_VERSION_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh" + +prepare-e2e CONTROLLER_NAME=update-demo diff --git a/hack/e2e.go b/hack/e2e.go index b5d8da8a8d3..0ca85d26f67 100644 --- a/hack/e2e.go +++ b/hack/e2e.go @@ -137,9 +137,12 @@ func main() { log.Fatalf("Error preparing a binary of version %s: %s. Aborting.", *version, err) } else { versionRoot = newVersionRoot + os.Setenv("KUBE_VERSION_ROOT", newVersionRoot) } } + os.Setenv("KUBECTL", versionRoot+`/cluster/kubectl.sh`+kubectlArgs()) + if *pushup { if IsUp() { log.Printf("e2e cluster is up, pushing.")