Skip to content

Commit 2da1689

Browse files
authored
Merge pull request #261 from weizhouapache/Makefile-add-run-e2e-smoke
Makefile/e2e: ensure cloud-config.yaml exists
2 parents 12c0845 + 765fd0b commit 2da1689

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,13 @@ run-e2e: e2e-essentials ## Run e2e testing. JOB is an optional REGEXP to select
289289
-e2e.artifacts-folder=${REPO_ROOT}/_artifacts \
290290
-e2e.config=${E2E_CONFIG} \
291291
-e2e.skip-resource-cleanup=false -e2e.use-existing-cluster=true
292+
EXIT_STATUS=$$?
292293
kind delete clusters capi-test
294+
exit $$EXIT_STATUS
293295

294296
run-e2e-smoke:
295-
hack/ensure-kind.sh
297+
./hack/ensure-kind.sh
298+
./hack/ensure-cloud-config-yaml.sh
296299
JOB="\"CAPC E2E SMOKE TEST\"" $(MAKE) run-e2e
297300

298301
##@ Cleanup

hack/ensure-cloud-config-yaml.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2019 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -o errexit
18+
set -o nounset
19+
set -o pipefail
20+
21+
# This ensures that cloud-config.yaml exists which is required for e2e smoke test
22+
if [ ! -f "cloud-config.yaml" ];then
23+
echo "cloud-config.yaml is not found, creating"
24+
cat >cloud-config.yaml <<EOF
25+
apiVersion: v1
26+
kind: Secret
27+
metadata:
28+
name: secret1
29+
namespace: default
30+
type: Opaque
31+
stringData:
32+
api-key: XXXX
33+
secret-key: XXXX
34+
api-url: http://1.2.3.4:8080/client/api
35+
verify-ssl: "false"
36+
EOF
37+
38+
fi

0 commit comments

Comments
 (0)