From cd4302a0eca7a68e84598f62598e4cbfb4a728aa Mon Sep 17 00:00:00 2001 From: Yecheng Fu Date: Mon, 23 Mar 2020 16:13:51 +0800 Subject: [PATCH] fix args passing (#2010) --- hack/run-e2e.sh | 18 +++++++++--------- tests/e2e/e2e_test.go | 5 +++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/hack/run-e2e.sh b/hack/run-e2e.sh index b83846cb9e..69914dc0fd 100755 --- a/hack/run-e2e.sh +++ b/hack/run-e2e.sh @@ -325,11 +325,11 @@ e2e_args=( -- --clean-start=true --delete-namespace-on-failure=false - --repo-root=$ROOT + --repo-root="$ROOT" # tidb-operator e2e flags --operator-tag=e2e - --operator-image=${TIDB_OPERATOR_IMAGE} - --e2e-image=${E2E_IMAGE} + --operator-image="${TIDB_OPERATOR_IMAGE}" + --e2e-image="${E2E_IMAGE}" # two tidb versions can be configuraed: , --tidb-versions=v3.0.7,v3.0.8 --chart-dir=/charts @@ -354,7 +354,7 @@ docker_args=( if [ "$PROVIDER" == "eks" ]; then e2e_args+=( --provider=aws - --gce-zone ${AWS_REGION} + --gce-zone="${AWS_REGION}" ) # aws credential is required to get token for EKS docker_args+=( @@ -362,10 +362,10 @@ if [ "$PROVIDER" == "eks" ]; then ) elif [ "$PROVIDER" == "gke" ]; then e2e_args+=( - --provider=${PROVIDER} - --gce-project ${GCP_PROJECT} - --gce-region ${GCP_REGION} - --gce-zone ${GCP_ZONE} + --provider="${PROVIDER}" + --gce-project="${GCP_PROJECT}" + --gce-region="${GCP_REGION}" + --gce-zone="${GCP_ZONE}" ) docker_args+=( -v ${GCP_CREDENTIALS}:${GCP_CREDENTIALS} @@ -382,7 +382,7 @@ elif [ "$PROVIDER" == "gke" ]; then ) else e2e_args+=( - --provider=${PROVIDER} + --provider="${PROVIDER}" ) fi diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 5a49655b5a..3552bf2bb6 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -22,6 +22,7 @@ import ( "time" e2econfig "github.com/pingcap/tidb-operator/tests/e2e/config" + "k8s.io/klog" "k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework/config" "k8s.io/kubernetes/test/e2e/framework/testfiles" @@ -52,6 +53,10 @@ func TestMain(m *testing.M) { // Register test flags, then parse flags. handleFlags() + flag.CommandLine.VisitAll(func(flag *flag.Flag) { + klog.V(1).Infof("FLAG: --%s=%q", flag.Name, flag.Value) + }) + // Now that we know which Viper config (if any) was chosen, // parse it and update those options which weren't already set via command line flags // (which have higher priority).