Skip to content

Commit ebb19e5

Browse files
authored
Fix the failing nightly test (#3803)
The test, as preparations, installs the latest version of OLM, then it installs the cert-manager. But the latest version of OLM, rleased 2 days ago, requires cert-manager to be already installed. This PR changes the order so the test will first install cert-manager, and only then install OLM. Also, stop using the deploy/cert-manager.yaml file. Instead, use the file from the cert-manager source, directly. Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
1 parent ae04ff8 commit ebb19e5

File tree

6 files changed

+27
-10
lines changed

6 files changed

+27
-10
lines changed

automation/nightly/test-nightly-build.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ chmod +x operator-sdk
135135
OLM_VERSION=$(curl https://api.github.com/repos/operator-framework/operator-lifecycle-manager/releases/latest | jq -r .name)
136136

137137
# start K8s cluster
138-
export KUBEVIRT_PROVIDER=k8s-1.32
138+
export KUBEVIRT_PROVIDER=k8s-1.34
139139
export KUBEVIRT_MEMORY_SIZE=12G
140140
export KUBEVIRT_NUM_NODES=4
141141
# cluster/kubevirtci_tag.txt is auto updated by hack/bump-kubevirtci.sh
@@ -145,13 +145,11 @@ make cluster-up
145145
export KUBECONFIG=$(_kubevirtci/cluster-up/kubeconfig.sh)
146146
export KUBECTL=$(pwd)/_kubevirtci/cluster-up/kubectl.sh
147147

148+
CMD=${KUBECTL} ./hack/deploy-cert-manager.sh
149+
148150
# install OLM on the cluster
149151
./operator-sdk olm install --version "${OLM_VERSION}"
150152

151-
# Deploy cert-manager for webhooks
152-
$KUBECTL apply -f deploy/cert-manager.yaml
153-
$KUBECTL -n cert-manager wait deployment/cert-manager-webhook --for=condition=Available --timeout="300s"
154-
155153
trap "dump" INT TERM EXIT
156154

157155
# install HCO on the cluster

deploy/deploy.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ set -ex
44

55
hco_namespace=kubevirt-hyperconverged
66

7+
CERT_MANAGER_VERSION=${CERT_MANAGER_VERSION:-"v1.18.2"}
8+
79
IS_OPENSHIFT=${IS_OPENSHIFT:-false}
810
if kubectl api-resources |grep clusterversions |grep config.openshift.io; then
911
IS_OPENSHIFT="true"
@@ -36,7 +38,7 @@ kubectl apply ${LABEL_SELECTOR_ARG} -f https://raw.githubusercontent.com/kubevir
3638
kubectl apply ${LABEL_SELECTOR_ARG} -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/main/deploy/crds/application-aware-quota00.crd.yaml
3739

3840
# Deploy cert-manager for webhook certificates
39-
kubectl apply ${LABEL_SELECTOR_ARG} -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/main/deploy/cert-manager.yaml
41+
kubectl apply -f "https://github.com/cert-manager/cert-manager/releases/download/${CERT_MANAGER_VERSION}/cert-manager.yaml"
4042
kubectl -n cert-manager wait deployment/cert-manager --for=condition=Available --timeout="300s"
4143
kubectl -n cert-manager wait deployment/cert-manager-webhook --for=condition=Available --timeout="300s"
4244

hack/clean.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ source hack/common.sh
5252
"${CMD}" delete -f _out/service_account.yaml --ignore-not-found || true
5353

5454
# Remove cert-manager
55-
"${CMD}" delete -f _out/cert-manager.yaml --ignore-not-found || true
55+
"${CMD}" delete -f "https://github.com/cert-manager/cert-manager/releases/download/${CERT_MANAGER_VERSION}/cert-manager.yaml" --ignore-not-found || true
5656
"${CMD}" delete validatingwebhookconfigurations cert-manager-webhook --ignore-not-found || true
5757
"${CMD}" delete mutatingwebhookconfigurations cert-manager-webhook --ignore-not-found || true
5858
"${CMD}" delete secrets -n kubevirt-hyperconverged -l controller.cert-manager.io/fao=true --ignore-not-found || true

hack/common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ KUBECTL=${KUBECTL:-}
3939
TEST_OUT_PATH=${TEST_OUT_PATH:-"tests/func-tests/_out"}
4040
JOB_TYPE=${JOB_TYPE:-}
4141

42+
CERT_MANAGER_VERSION=${CERT_MANAGER_VERSION:-"v1.18.2"}
43+
4244
KUBECTL=$(which kubectl 2> /dev/null) || true
4345

4446
if [ -z "${CMD}" ]; then

hack/deploy-cert-manager.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
source hack/common.sh
4+
5+
set -ex
6+
7+
CERT_MANAGER_TIMEOUT=${CERT_MANAGER_TIMEOUT:-"120s"}
8+
9+
echo "Installing cert-manager ${CERT_MANAGER_VERSION}"
10+
${CMD} apply -f https://github.com/cert-manager/cert-manager/releases/download/${CERT_MANAGER_VERSION}/cert-manager.yaml
11+
12+
echo "Waiting for cert-manager to be ready..."
13+
${CMD} wait --for=condition=Available --namespace=cert-manager deployment/cert-manager --timeout=${CERT_MANAGER_TIMEOUT}
14+
${CMD} wait --for=condition=Available --namespace=cert-manager deployment/cert-manager-cainjector --timeout=${CERT_MANAGER_TIMEOUT}
15+
${CMD} wait --for=condition=Available --namespace=cert-manager deployment/cert-manager-webhook --timeout=${CERT_MANAGER_TIMEOUT}
16+
17+
echo "cert-manager ${CERT_MANAGER_VERSION} installed successfully"

hack/deploy.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@ if [ "$IS_OPENSHIFT" != "true" ]; then
114114
LABEL_SELECTOR_ARG="-l name!=ssp-operator,name!=hyperconverged-cluster-cli-download"
115115
fi
116116

117-
# Deploy cert-manager for webhooks
118-
"${CMD}" apply -f _out/cert-manager.yaml
119-
"${CMD}" -n cert-manager wait deployment/cert-manager-webhook --for=condition=Available --timeout="300s"
117+
hack/deploy-cert-manager.sh
120118

121119
# Deploy local manifests
122120
"${CMD}" apply $LABEL_SELECTOR_ARG -f _out/cluster_role.yaml

0 commit comments

Comments
 (0)