Skip to content

Commit

Permalink
Fix Openshift test (#1882)
Browse files Browse the repository at this point in the history
* Fix Openshift test

---------

Signed-off-by: pjuarezd <pjuarezd@users.noreply.github.com>
  • Loading branch information
pjuarezd authored Nov 27, 2023
1 parent 12c746e commit 8030876
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -764,4 +764,4 @@ spec:
- image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3
name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation
version: 5.0.11
replaces: minio-operator.v5.0.9
replaces: minio-operator.v5.0.10
Original file line number Diff line number Diff line change
Expand Up @@ -766,4 +766,4 @@ spec:
- image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3
name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation
version: 5.0.11
replaces: minio-operator-rhmp.v5.0.9
replaces: minio-operator-rhmp.v5.0.10
Original file line number Diff line number Diff line change
Expand Up @@ -766,4 +766,4 @@ spec:
- image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3
name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation
version: 5.0.11
replaces: minio-operator.v5.0.9
replaces: minio-operator.v5.0.10
2 changes: 1 addition & 1 deletion manifests/minio-operator-rhmp.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -768,4 +768,4 @@ spec:
- image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3
name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation
version: 5.0.11
replaces: minio-operator-rhmp.v5.0.9
replaces: minio-operator-rhmp.v5.0.10
2 changes: 1 addition & 1 deletion olm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ for catalog in "${redhatCatalogs[@]}"; do
# You can read the documentation at link below:
# https://access.redhat.com/documentation/en-us/openshift_container_platform/4.2/html/operators/understanding-the-operator-lifecycle-manager-olm#olm-upgrades_olm-understanding-olm
echo "To provide replacement for upgrading Operator..."
PREV_VERSION=$(curl -s "https://catalog.redhat.com/api/containers/v1/operators/bundles?channel_name=stable&package=${package}&organization=${catalog}&include=data.version,data.csv_name,data.ocp_version" | jq '.data | max_by(.version).csv_name' -r)
PREV_VERSION=$(curl -s "https://catalog.redhat.com/api/containers/v1/operators/bundles?channel_name=stable&package=${package}&organization=${catalog}&include=data.version,data.csv_name,data.ocp_version" | jq '.data | max_by(.version | split(".") | map(tonumber)).csv_name' -r)
echo "replaces: $PREV_VERSION"
yq -i e ".spec.replaces |= \"${PREV_VERSION}\"" bundles/$catalog/$RELEASE/manifests/$package.clusterserviceversion.yaml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -768,4 +768,4 @@ spec:
- image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3
name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation
version: 5.0.11
replaces: minio-operator-rhmp.v5.0.9
replaces: minio-operator-rhmp.v5.0.10
7 changes: 4 additions & 3 deletions testing/openshift-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function setup_crc() {
crc config set skip-check-root-user true
crc config set kubeadmin-password "crclocal"
crc setup -b $bundle_url
crc start -b $bundle -c 12 -m 20480
crc start -c 12 -m 20480
eval $(crc oc-env)
eval $(crc podman-env)
# this creates a symlink "podman" from the "podman-remote", as a hack to solve the a issue with opm:
Expand All @@ -84,7 +84,7 @@ function setup_crc() {
ln -sf $ocpath/podman-remote $ocpath/podman
try crc version
echo "Waiting for podman vm come online (5m timeout)"
try timeout 600 bash -c -- 'while ! podman image ls 2> /dev/null; do sleep 1 && printf ".";done'
timeout 600 bash -c -- 'while ! podman image ls 2> /dev/null; do sleep 1 && printf ".";done'
oc login -u kubeadmin -p crclocal https://api.crc.testing:6443 --insecure-skip-tls-verify=true
}

Expand Down Expand Up @@ -152,6 +152,7 @@ function create_marketplace_catalog() {
yq -i ".metadata.annotations.containerImage |= (\"${operatorrepotag}\")" ${SCRIPT_DIR}/openshift/bundle/manifests/$package.clusterserviceversion.yaml
yq -i ".spec.install.spec.deployments.[0].spec.template.spec.containers.[0].image |= (\"${operatorrepotag}\")" ${SCRIPT_DIR}/openshift/bundle/manifests/$package.clusterserviceversion.yaml
yq -i ".spec.install.spec.deployments.[1].spec.template.spec.containers.[0].image |= (\"${operatorrepotag}\")" ${SCRIPT_DIR}/openshift/bundle/manifests/$package.clusterserviceversion.yaml
yq -i "del(.spec.replaces)" ${SCRIPT_DIR}/openshift/bundle/manifests/$package.clusterserviceversion.yaml
yq -i ".annotations.\"operators.operatorframework.io.bundle.package.v1\" |= (\"${package}-noop\")" ${SCRIPT_DIR}/openshift/bundle/metadata/annotations.yaml
(cd "${SCRIPT_DIR}/.." && podman build --quiet --no-cache -t $bundleContainerImage -f ${SCRIPT_DIR}/openshift/bundle.Dockerfile ${SCRIPT_DIR}/openshift)
podman login -u $(oc whoami) -p $(oc whoami --show-token) $registry --tls-verify=false
Expand All @@ -164,7 +165,7 @@ function create_marketplace_catalog() {
try oc set image-lookup -n $marketplaceNamespace operator-bundle

echo "Compiling marketplace index"
opm index add --bundles $bundleContainerImage --tag $indexContainerImage --skip-tls-verify=true
opm index add --bundles $bundleContainerImage --tag $indexContainerImage --skip-tls-verify=true --pull-tool podman

echo "push minio-operator-index to crc registry"
podman push $indexContainerImage --tls-verify=false
Expand Down

0 comments on commit 8030876

Please sign in to comment.