8000 fix: switching to the registry addon for olm testing by shawkins · Pull Request #40334 · keycloak/keycloak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/operator-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,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.2:5000

- name: Install OPM
uses: redhat-actions/openshift-tools-installer@144527c7d98999f2652264c048c7a9bd103f8a82 # v1.13.1
Expand All @@ -169,7 +169,7 @@ jobs:
working-directory: operator
run: |
eval $(minikube -p minikube docker-env)
./scripts/olm-testing.sh ${GITHUB_SHA::6}
REGISTRY=192.168.49.2:5000 ./scripts/olm-testing.sh ${GITHUB_SHA::6}
Copy link
8000
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to assume the IP address? Shouldn't we use something like $(minikube ip) instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It already has to be hard-coded in the minikube start --insecure-registries, but yes you could change this spot if you want.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to provide the --insecure-registry option? Problem is at that point we can't get the minikube's IP as it's not started yet.

Copy link
Contributor Author
@shawkins shawkins Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to provide the --insecure-registry option?

Yes - https://minikube.sigs.k8s.io/docs/handbook/pushing/#4-pushing-to-an-in-cluster-using-registry-addon

Problem is at that point we can't get the minikube's IP as it's not started yet.

Correct - if we change to a different driver, the ip may change. See that the docs refer you to this code https://github.com/kubernetes/minikube/blob/dfd9b6b83d0ca2eeab55588a16032688bc26c348/pkg/minikube/cluster/cluster.go#L408

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's keep as is and we'll reconsider if it breaks.


- name: Deploy an example Keycloak and wait for it to be ready
working-directory: operator
Expand Down
2 changes: 1 addition & 1 deletion operator/scripts/create-olm-test-catalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
13 changes: 7 additions & 6 deletions operator/scripts/olm-testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,29 @@ 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
(
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
Loading
0