Skip to content

Commit 41876ff

Browse files
author
Richard Kovacs
committed
Skip installation of CCM for e2e
1 parent ba26737 commit 41876ff

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

e2e/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@ test-cluster: kind ctlptl kind clean-cluster
1616
./test/scripts/create_management_cluster.sh $(K8S_VERSION)
1717

1818
clean-cluster: ctlptl
19-
$(CTLPTL) delete cluster kind-management --ignore-not-found
19+
$(CTLPTL) delete cluster kind-ccm-management --ignore-not-found
2020
rm -rf $(MANAGEMENT_KUBECONFIG)
2121

2222
reuse-and-test: SUITE_ARGS='--reuse'
2323

24-
test reuse-and-test: clusterctl ginkgo check-token test-cluster
24+
test reuse-and-test: clusterctl check-token test-cluster _test
25+
$(MAKE) clean-cluster
26+
27+
_test: ginkgo
2528
go list -m; \
2629
MANAGEMENT_KUBECONFIG=$(ROOT_DIR)/e2e/$(MANAGEMENT_KUBECONFIG) $(GINKGO) -r --vv --trace $(TEST_ARGS) -- --image=${IMG} --k8s_version=${K8S_VERSION} $(SUITE_ARGS)
2730

28-
$(MAKE) clean-cluster
29-
3031
clean: check-token
3132
cd test; \
3233
./scripts/delete_cluster.sh ccm-linode-for-reuse

e2e/test/scripts/create_cluster.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fi
2525

2626
(cd ${ROOT_DIR}/deploy ; set +x ; ./generate-manifest.sh ${LINODE_TOKEN} ${LINODE_REGION})
2727

28-
kubectl create ns ${CLUSTER_NAME}
28+
kubectl create ns ${CLUSTER_NAME} ||:
2929
(cd $(realpath "$(dirname "$0")"); clusterctl generate cluster ${CLUSTER_NAME} \
3030
--target-namespace ${CLUSTER_NAME} \
3131
--flavor clusterclass-kubeadm \
@@ -37,9 +37,7 @@ until kubectl get secret -n ${CLUSTER_NAME} ${CLUSTER_NAME}-kubeconfig; do
3737
sleep $(((c--)))
3838
done
3939

40-
kubectl get secret -n ${CLUSTER_NAME} ${CLUSTER_NAME}-kubeconfig -o jsonpath="{.data.value}" \
41-
| base64 --decode \
42-
> "$(pwd)/${CLUSTER_NAME}.conf"
40+
clusterctl get kubeconfig -n ${CLUSTER_NAME} ${CLUSTER_NAME} > "$(pwd)/${CLUSTER_NAME}.conf"
4341

4442
export KUBECONFIG="$(pwd)/${CLUSTER_NAME}.conf"
4543

@@ -48,9 +46,6 @@ until kubectl version; do
4846
sleep $(((c--)))
4947
done
5048

51-
# Skip if it's failing because of CCM is already exists.
52-
kubectl apply -f ${ROOT_DIR}/deploy/ccm-linode.yaml || kubectl get clusterrole ccm-linode-clusterrole
53-
5449
c=24
5550
until [[ $(kubectl get no --no-headers | grep Ready | wc -l) == 3 ]]; do
5651
sleep $(((c--)))

e2e/test/scripts/create_management_cluster.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ export HELM_VERSION="v0.2.1"
1212
export KUBECONFIG="$(realpath "$(dirname "$0")/../kind-management.conf")"
1313

1414
ctlptl create cluster kind \
15-
--name kind-management \
15+
--name kind-ccm-management \
1616
--kubernetes-version ${KUBERNETES_VERSION}
1717

1818
prepare_images() {
1919
local images="$(echo "$1" | grep -e "^[[:space:]]*image:[?[:space:]]" | awk '{print $2}')"
2020

21-
echo "${images//[\'\"]}" | xargs -I {} sh -c 'docker pull '{}' ; kind -n management load docker-image '{}
21+
echo "${images//[\'\"]}" | xargs -I {} sh -c 'docker pull '{}' ; kind -n ccm-management load docker-image '{}
2222
}
2323

2424
(set +x; prepare_images "$(curl -sfL $(cat $(realpath "$(dirname "$0")/clusterctl.yaml") | grep cluster-api-provider-linode | awk '{print $2}'))")

0 commit comments

Comments
 (0)