From 2ee3c7053e6e82588a9a79b3f8e6d8dfacc2c2ea Mon Sep 17 00:00:00 2001 From: Erik Berg Date: Tue, 29 Apr 2025 08:01:17 +0200 Subject: [PATCH] Fix issues with metallb on OKD Slightly different approach, just get the latest (v0.14.2) release, patch what needs to be patched and and apply with -k for kustomize. No need to wait for operatorhub.io or the deployment to fail before patching. The deployment for webhook-server wants to pull quay.io/metallb/controller:main for the webhook-server. Which seems to be a moving target, and recently was expecting to find an additional CRD for service.BGPStatuses. So we pin the controller to v0.14.5, which is what the other controller images are pinned to in this release. --- Makefile | 10 +---- scripts/gen-olm-metallb-okd.sh | 66 +++++------------------------ scripts/gen-operatorshub-catalog.sh | 42 ------------------ 3 files changed, 13 insertions(+), 105 deletions(-) delete mode 100644 scripts/gen-operatorshub-catalog.sh diff --git a/Makefile b/Makefile index 65348291..07c664c3 100644 --- a/Makefile +++ b/Makefile @@ -2463,16 +2463,10 @@ metallb: ## installs metallb operator in the metallb-system namespace oc apply -f ${OUT}/${NAMESPACE}/namespace.yaml timeout $(TIMEOUT) bash -c "while ! (oc get project.v1.project.openshift.io ${NAMESPACE}); do sleep 1; done" ifeq ($(OKD), true) - bash scripts/gen-operatorshub-catalog.sh - oc apply -f ${OPERATOR_DIR}/operatorshub-catalog/ - timeout ${TIMEOUT} bash -c "while ! (oc get packagemanifests metallb-operator --no-headers=true | grep metallb-operator); do sleep 10; done" bash scripts/gen-olm-metallb-okd.sh - oc apply -f ${OPERATOR_DIR} - timeout ${TIMEOUT} bash -c "while ! (oc get deployment metallb-operator-controller-manager --no-headers=true -n ${NAMESPACE}| grep metallb-operator-controller-manager); do sleep 10; done" - oc apply -f ${OPERATOR_DIR}/patches + oc apply -k ${OPERATOR_DIR}/config/openshift + oc apply -f ${OPERATOR_DIR}/config/metallb_rbac/metallb-openshift.yaml oc wait -n ${NAMESPACE} --for=condition=Available deployment/metallb-operator-controller-manager --timeout=${TIMEOUT} - # we ensure the outdated replica is terminated (i.e only one replica available) - timeout ${TIMEOUT} bash -c "while ! (oc get pod --no-headers=true -l control-plane=controller-manager -n ${NAMESPACE}| grep metallb-operator-controller | wc -l | grep -q -e 1); do sleep 10; done" else bash scripts/gen-olm-metallb.sh oc apply -f ${OPERATOR_DIR} diff --git a/scripts/gen-olm-metallb-okd.sh b/scripts/gen-olm-metallb-okd.sh index 59ae83e4..49bc7943 100644 --- a/scripts/gen-olm-metallb-okd.sh +++ b/scripts/gen-olm-metallb-okd.sh @@ -38,48 +38,9 @@ fi echo OPERATOR_DIR ${OPERATOR_DIR} echo DEPLOY_DIR ${DEPLOY_DIR} -cat > ${OPERATOR_DIR}/operatorgroup.yaml < ${OPERATOR_DIR}/subscription.yaml < ${OPERATOR_DIR}/patches/patch-deployment-controller-manager.yaml < ${OPERATOR_DIR}/patches/patch-deployment-webhook-server.yaml < ${OPERATOR_DIR}/config/openshift/patch-deployment-webhook-server.yaml < ${OPERATOR_DIR}/patches/privileged-role-binding.yaml < ${DEPLOY_DIR}/deploy_operator.yaml < ${OPERATOR_DIR}/operatorshub-catalog/operatorshub-catalog.yaml <