fix: switching to the registry addon for olm testing (#40334) (#40349)

closes: #40099


(cherry picked from commit eb96b4a59f25b0cf0715c21f0b0d8325b4d4c5b9)

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
This commit is contained in:
Steven Hawkins 2025-06-10 06:12:35 -04:00 committed by GitHub
parent bd87850cd2
commit 9e6e9e37c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 9 deletions

View File

@ -180,7 +180,7 @@ jobs:
kubernetes version: ${{ env.KUBERNETES_VERSION }}
github token: ${{ secrets.GITHUB_TOKEN }}
driver: docker
start args: --memory=${{ env.MINIKUBE_MEMORY }}
start args: --memory=${{ env.MINIKUBE_MEMORY }} --addons=registry --insecure-registry=192.168.49.0/24
- name: Install OPM
uses: redhat-actions/openshift-tools-installer@v1
@ -205,8 +205,9 @@ jobs:
- name: Arrange OLM test installation
working-directory: operator
run: |
echo "Minikube IP $(minikube ip)"
eval $(minikube -p minikube docker-env)
./scripts/olm-testing.sh ${GITHUB_SHA::6}
REGISTRY=$(minikube ip):5000 ./scripts/olm-testing.sh ${GITHUB_SHA::6}
- name: Deploy an example Keycloak and wait for it to be ready
working-directory: operator

View File

@ -19,7 +19,7 @@ mkdir -p $SCRIPT_DIR/../olm/catalog/test-catalog
--output yaml > test-catalog/operator.yaml
opm render $BUNDLE_IMAGE:$VERSION \
--output=yaml >> test-catalog/operator.yaml
--output=yaml --skip-tls >> test-catalog/operator.yaml
cat << EOF >> test-catalog/operator.yaml
---

View File

@ -10,14 +10,15 @@ TARGET_NAMESPACES=${3-$INSTALL_NAMESPACE}
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# This version translates to one day for ttl.sh
REGISTRY=${REGISTRY:-ttl.sh}
VERSION="86400000.0.0"
# Build Keycloak Docker image (the keycloak tar.gz should already be in the container folder)
(
cd $SCRIPT_DIR/../../quarkus/container
docker build --build-arg KEYCLOAK_DIST=$(ls keycloak-*.tar.gz) . -t "ttl.sh/${UUID}keycloak:${VERSION}"
docker push "ttl.sh/${UUID}keycloak:${VERSION}"
docker build --build-arg KEYCLOAK_DIST=$(ls keycloak-*.tar.gz) . -t "$REGISTRY/${UUID}keycloak:${VERSION}"
docker push "$REGISTRY/${UUID}keycloak:${VERSION}"
)
# Build the operator Docker image
@ -25,13 +26,13 @@ VERSION="86400000.0.0"
cd $SCRIPT_DIR/../../
./mvnw clean package -Poperator -pl :keycloak-operator -am \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.image="ttl.sh/${UUID}keycloak-operator:${VERSION}" \
-Dkc.operator.keycloak.image="ttl.sh/${UUID}keycloak:${VERSION}" \
-Dquarkus.container-image.image="$REGISTRY/${UUID}keycloak-operator:${VERSION}" \
-Dkc.operator.keycloak.image="$REGISTRY/${UUID}keycloak:${VERSION}" \
-DskipTests
# JIB patching on images doesn't work reliably with ttl.sh
docker push "ttl.sh/${UUID}keycloak-operator:${VERSION}"
docker push "$REGISTRY/${UUID}keycloak-operator:${VERSION}"
)
$SCRIPT_DIR/prepare-olm-test.sh ttl.sh ${VERSION} NONE ${UUID} $TARGET_NAMESPACES
$SCRIPT_DIR/prepare-olm-test.sh $REGISTRY ${VERSION} NONE ${UUID} $TARGET_NAMESPACES
$SCRIPT_DIR/install-keycloak-operator.sh $INSTALL_NAMESPACE