@@ -14,6 +14,7 @@ usage() {
14
14
echo " test-manifest.yaml - The test manifest, which defines cluster, and deployments"
15
15
}
16
16
17
+ CREATE_CLUSTER=${CREATE_CLUSTER:- true}
17
18
HEADLESS=${HEADLESS:- false}
18
19
TEST_DIRECTORY=$1
19
20
if [ -z " ${TEST_DIRECTORY} " ]; then
@@ -30,23 +31,26 @@ if [ ! -f "${testManifest}" ]; then
30
31
fi
31
32
32
33
set -eo pipefail # Exit immediately if a command fails.
34
+
33
35
#
34
36
# Cluster creation
35
37
#
36
- clusterType=$( yq -r " .cluster.type // \" kind\" " " ${testManifest} " )
37
- clusterName=$( yq -r " .cluster.name // \" $( basename " ${TEST_DIRECTORY} " ) \" " " ${testManifest} " )
38
- clusterConfig=$( yq -r " .cluster.config // \"\" " " ${testManifest} " )
38
+ if [ " ${CREATE_CLUSTER} " == " true" ]; then
39
+ clusterType=$( yq -r " .cluster.type // \" kind\" " " ${testManifest} " )
40
+ clusterName=$( yq -r " .cluster.name // \" $( basename " ${TEST_DIRECTORY} " ) \" " " ${testManifest} " )
41
+ clusterConfig=$( yq -r " .cluster.config // \"\" " " ${testManifest} " )
39
42
40
- if [ " ${clusterType} " == " kind" ]; then
41
- if ! kind get clusters | grep -q " ${clusterName} " ; then
42
- if [ ! -f " ${clusterConfig} " ]; then
43
- kind create cluster --name " ${clusterName} "
44
- else
45
- kind create cluster --name " ${clusterName} " --config " ${TEST_DIRECTORY} /${clusterConfig} "
43
+ if [ " ${clusterType} " == " kind" ]; then
44
+ if ! kind get clusters | grep -q " ${clusterName} " ; then
45
+ if [ ! -f " ${clusterConfig} " ]; then
46
+ kind create cluster --name " ${clusterName} "
47
+ else
48
+ kind create cluster --name " ${clusterName} " --config " ${TEST_DIRECTORY} /${clusterConfig} "
49
+ fi
46
50
fi
51
+ else
52
+ echo " Unknown cluster type: \" ${clusterType} \" "
47
53
fi
48
- else
49
- echo " Unknown cluster type: \" ${clusterType} \" "
50
54
fi
51
55
52
56
#
0 commit comments