From c80fa3763e3af043148457b7c0223ce7ff698504 Mon Sep 17 00:00:00 2001 From: Yecheng Fu Date: Tue, 7 Apr 2020 15:09:16 +0800 Subject: [PATCH 1/2] support v. format in KUBE_VERSION and add v1.18 support --- ci/pingcap_tidb_operator_build_kind.groovy | 4 ++-- hack/e2e.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ci/pingcap_tidb_operator_build_kind.groovy b/ci/pingcap_tidb_operator_build_kind.groovy index fff7b5eac6..4b8baf5b0b 100644 --- a/ci/pingcap_tidb_operator_build_kind.groovy +++ b/ci/pingcap_tidb_operator_build_kind.groovy @@ -243,8 +243,8 @@ def call(BUILD_BRANCH, CREDENTIALS_ID, CODECOV_CREDENTIALS_ID) { builds["E2E v1.12.10 AdvancedStatefulSet"] = { build("${MIRRORS} RUNNER_SUITE_NAME=e2e-v1.12-advanced-statefulset IMAGE_TAG=${GITHASH} SKIP_BUILD=y GINKGO_NODES=6 KUBE_VERSION=v1.12.10 REPORT_DIR=\$(pwd)/artifacts REPORT_PREFIX=v1.12.10_advanced_statefulset ./hack/e2e.sh -- --preload-images --operator-features AdvancedStatefulSet=true", artifacts) } - builds["E2E v1.17.0"] = { - build("${MIRRORS} RUNNER_SUITE_NAME=e2e-v1.17 IMAGE_TAG=${GITHASH} SKIP_BUILD=y GINKGO_NODES=6 KUBE_VERSION=v1.17.0 REPORT_DIR=\$(pwd)/artifacts REPORT_PREFIX=v1.17.0_ ./hack/e2e.sh -- -preload-images", artifacts) + builds["E2E v1.18.0"] = { + build("${MIRRORS} RUNNER_SUITE_NAME=e2e-v1.18 IMAGE_TAG=${GITHASH} SKIP_BUILD=y GINKGO_NODES=6 KUBE_VERSION=v1.18.0 REPORT_DIR=\$(pwd)/artifacts REPORT_PREFIX=v1.18.0_ ./hack/e2e.sh -- -preload-images", artifacts) } builds["E2E v1.12.10 Serial"] = { build("${MIRRORS} RUNNER_SUITE_NAME=e2e-v1.12-serial IMAGE_TAG=${GITHASH} SKIP_BUILD=y KUBE_VERSION=v1.12.10 REPORT_DIR=\$(pwd)/artifacts REPORT_PREFIX=v1.12.10_serial_ ./hack/e2e.sh -- --preload-images --ginkgo.focus='\\[Serial\\]' --install-operator=false", artifacts) diff --git a/hack/e2e.sh b/hack/e2e.sh index 30cc4af4aa..0fd6ccd0c7 100755 --- a/hack/e2e.sh +++ b/hack/e2e.sh @@ -237,7 +237,8 @@ kind_node_images["v1.13.12"]="kindest/node:v1.13.12@sha256:5e8ae1a4e39f3d151d420 kind_node_images["v1.14.10"]="kindest/node:v1.14.10@sha256:81ae5a3237c779efc4dda43cc81c696f88a194abcc4f8fa34f86cf674aa14977" kind_node_images["v1.15.7"]="kindest/node:v1.15.7@sha256:e2df133f80ef633c53c0200114fce2ed5e1f6947477dbc83261a6a921169488d" kind_node_images["v1.16.4"]="kindest/node:v1.16.4@sha256:b91a2c2317a000f3a783489dfb755064177dbc3a0b2f4147d50f04825d016f55" -kind_node_images["v1.17.0"]="kindest/node:v1.17.0@sha256:9512edae126da271b66b990b6fff768fbb7cd786c7d39e86bdf55906352fdf62" +kind_node_images["v1.17.2"]="kindest/node:v1.17.2@sha256:59df31fc61d1da5f46e8a61ef612fa53d3f9140f82419d1ef1a6b9656c6b737c" +kind_node_images["v1.18.0"]="kindest/node:v1.18.0@sha256:0e20578828edd939d25eb98496a685c76c98d54084932f76069f886ec315d694" function e2e::image_build() { if [ -n "$SKIP_BUILD" ]; then @@ -396,7 +397,10 @@ if [ "$PROVIDER" == "kind" ]; then cat $tmpfile image="" for v in ${!kind_node_images[*]}; do - if [[ "$KUBE_VERSION" == "$v" ]]; then + if [[ "$KUBE_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ && "$KUBE_VERSION" == "$v" ]]; then + image=${kind_node_images[$v]} + echo "info: image for $KUBE_VERSION: $image" + elif [[ "$KUBE_VERSION" =~ ^v[0-9]+\.[0-9]+$ && "$KUBE_VERSION" == "${v%.*}" ]]; then image=${kind_node_images[$v]} echo "info: image for $KUBE_VERSION: $image" fi From 97e45e00b57ace27752d560ca00977486bccd1c8 Mon Sep 17 00:00:00 2001 From: Yecheng Fu Date: Tue, 7 Apr 2020 15:16:47 +0800 Subject: [PATCH 2/2] move hack::ensure_xxx after envs are printed --- hack/e2e.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hack/e2e.sh b/hack/e2e.sh index 0fd6ccd0c7..ca4e016b1f 100755 --- a/hack/e2e.sh +++ b/hack/e2e.sh @@ -170,10 +170,6 @@ if [ "${1:-}" == "--" ]; then shift fi -hack::ensure_kind -hack::ensure_kubectl -hack::ensure_helm - PROVIDER=${PROVIDER:-kind} DOCKER_REGISTRY=${DOCKER_REGISTRY:-localhost:5000} IMAGE_TAG=${IMAGE_TAG:-latest} @@ -361,6 +357,10 @@ EOF } } +hack::ensure_kind +hack::ensure_kubectl +hack::ensure_helm + e2e::image_build if [ -n "$DOCKER_IO_MIRROR" -a -n "${DOCKER_IN_DOCKER_ENABLED:-}" ]; then