diff --git a/bundles/certified-operators/5.0.11/manifests/minio-operator.clusterserviceversion.yaml b/bundles/certified-operators/5.0.11/manifests/minio-operator.clusterserviceversion.yaml index 52a67b06644..92d1a4d3706 100644 --- a/bundles/certified-operators/5.0.11/manifests/minio-operator.clusterserviceversion.yaml +++ b/bundles/certified-operators/5.0.11/manifests/minio-operator.clusterserviceversion.yaml @@ -764,4 +764,3 @@ spec: - image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3 name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation version: 5.0.11 - replaces: minio-operator.v5.0.10 diff --git a/bundles/community-operators/5.0.11/manifests/minio-operator.clusterserviceversion.yaml b/bundles/community-operators/5.0.11/manifests/minio-operator.clusterserviceversion.yaml index bd3c098d0b6..92d1a4d3706 100644 --- a/bundles/community-operators/5.0.11/manifests/minio-operator.clusterserviceversion.yaml +++ b/bundles/community-operators/5.0.11/manifests/minio-operator.clusterserviceversion.yaml @@ -764,4 +764,3 @@ spec: - image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3 name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation version: 5.0.11 - replaces: "null" diff --git a/bundles/redhat-marketplace/5.0.11/manifests/minio-operator-rhmp.clusterserviceversion.yaml b/bundles/redhat-marketplace/5.0.11/manifests/minio-operator-rhmp.clusterserviceversion.yaml index 418d29e17ba..2b3d404ede9 100644 --- a/bundles/redhat-marketplace/5.0.11/manifests/minio-operator-rhmp.clusterserviceversion.yaml +++ b/bundles/redhat-marketplace/5.0.11/manifests/minio-operator-rhmp.clusterserviceversion.yaml @@ -759,11 +759,10 @@ spec: name: MinIO Inc url: https://min.io relatedImages: - - image: quay.io/minio/operator@sha256:3ab501c476f269c4e4fc84017543ff7f6c8209ed474d77de472311472ba2e2ff - name: console - image: quay.io/minio/operator@sha256:3ab501c476f269c4e4fc84017543ff7f6c8209ed474d77de472311472ba2e2ff name: minio-operator - image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3 name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation + - image: quay.io/minio/operator@sha256:3ab501c476f269c4e4fc84017543ff7f6c8209ed474d77de472311472ba2e2ff + name: console version: 5.0.11 - replaces: minio-operator-rhmp.v5.0.10 diff --git a/certified-operators/manifests/minio-operator.clusterserviceversion.yaml b/certified-operators/manifests/minio-operator.clusterserviceversion.yaml index e2b4f31b7bb..52cafecbe59 100644 --- a/certified-operators/manifests/minio-operator.clusterserviceversion.yaml +++ b/certified-operators/manifests/minio-operator.clusterserviceversion.yaml @@ -766,4 +766,3 @@ spec: - image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3 name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation version: 5.0.11 - replaces: minio-operator.v5.0.10 diff --git a/community-operators/manifests/minio-operator.clusterserviceversion.yaml b/community-operators/manifests/minio-operator.clusterserviceversion.yaml index 0c643208299..52cafecbe59 100644 --- a/community-operators/manifests/minio-operator.clusterserviceversion.yaml +++ b/community-operators/manifests/minio-operator.clusterserviceversion.yaml @@ -766,4 +766,3 @@ spec: - image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3 name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation version: 5.0.11 - replaces: "null" diff --git a/manifests/minio-operator-rhmp.clusterserviceversion.yaml b/manifests/minio-operator-rhmp.clusterserviceversion.yaml index 7d67c062bfa..13ad209d4ee 100644 --- a/manifests/minio-operator-rhmp.clusterserviceversion.yaml +++ b/manifests/minio-operator-rhmp.clusterserviceversion.yaml @@ -761,11 +761,10 @@ spec: name: MinIO Inc url: https://min.io relatedImages: - - image: minio/operator@sha256:3ab501c476f269c4e4fc84017543ff7f6c8209ed474d77de472311472ba2e2ff - name: console - image: minio/operator@sha256:3ab501c476f269c4e4fc84017543ff7f6c8209ed474d77de472311472ba2e2ff name: minio-operator - image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3 name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation + - image: minio/operator@sha256:3ab501c476f269c4e4fc84017543ff7f6c8209ed474d77de472311472ba2e2ff + name: console version: 5.0.11 - replaces: minio-operator-rhmp.v5.0.10 diff --git a/olm.sh b/olm.sh index e29ffe9e3da..19d9444ded7 100755 --- a/olm.sh +++ b/olm.sh @@ -42,6 +42,10 @@ echo "minioVersionDigest: ${minioVersionDigest}" redhatCatalogs=("certified-operators" "redhat-marketplace" "community-operators") +# This constants are supported Openshift versions +minOpenshiftVersion=4.8 +maxOpenshiftVersion=4.14 + for catalog in "${redhatCatalogs[@]}"; do echo " " echo $catalog @@ -70,13 +74,24 @@ for catalog in "${redhatCatalogs[@]}"; do yq -i ".spec.install.spec.deployments[0].spec.template.spec.containers[0].image |= (\"${operatorImageDigest}\")" bundles/$catalog/$RELEASE/manifests/$package.clusterserviceversion.yaml yq -i ".spec.install.spec.deployments[1].spec.template.spec.containers[0].image |= (\"${operatorImageDigest}\")" bundles/$catalog/$RELEASE/manifests/$package.clusterserviceversion.yaml - # To provide channel for upgrade where we tell what versions can be replaced by the new version we offer - # 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 | split(".") | map(tonumber)).csv_name' -r) - echo "replaces: $PREV_VERSION" - yq -i e ".spec.replaces |= \"${PREV_VERSION}\"" bundles/$catalog/$RELEASE/manifests/$package.clusterserviceversion.yaml + # Will query if a previous version of the CSV was published to the catalog of the latest supported Openshift version. + # It will help to prevent add the `spec.replaces` annotation when there is no preexisting CSV in the catalog to replace. + # See support case https://connect.redhat.com/support/technology-partner/#/case/03671253 + prev=$(curl -s "https://catalog.redhat.com/api/containers/v1/operators/bundles?channel_name=stable&package=${package}&organization=${catalog}&ocp_version=${maxOpenshiftVersion}&include=data.version,data.csv_name,data.ocp_version" | jq '.data | length' -r) + + # only add `spec.replaces` if at least one version have been published to the catalog + if [ "$prev" -gt 0 ]; then + # To provide channel for upgrade where we tell what versions can be replaced by the new version we offer + # 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) + echo "replaces: $PREV_VERSION" + yq -i e ".spec.replaces |= \"${PREV_VERSION}\"" bundles/$catalog/$RELEASE/manifests/$package.clusterserviceversion.yaml + else + echo "no previous published in catalog ${maxOpenshiftVersion}, removing spec.replaces" + yq -i "del(.spec.replaces) " bundles/$catalog/$RELEASE/manifests/$package.clusterserviceversion.yaml + fi # Now promote the latest release to the root of the repository rm -Rf manifests @@ -101,7 +116,7 @@ for catalog in "${redhatCatalogs[@]}"; do # as well as the default. { echo " # Annotations to specify OCP versions compatibility." - echo " com.redhat.openshift.versions: v4.8-v4.14" + echo " com.redhat.openshift.versions: v${minOpenshiftVersion}-v${maxOpenshiftVersion}" echo " # Annotation to add default bundle channel as potential is declared" echo " operators.operatorframework.io.bundle.channel.default.v1: stable" echo " operatorframework.io/suggested-namespace: minio-operator" diff --git a/redhat-marketplace/manifests/minio-operator-rhmp.clusterserviceversion.yaml b/redhat-marketplace/manifests/minio-operator-rhmp.clusterserviceversion.yaml index fedc8a07baa..b380178fad0 100644 --- a/redhat-marketplace/manifests/minio-operator-rhmp.clusterserviceversion.yaml +++ b/redhat-marketplace/manifests/minio-operator-rhmp.clusterserviceversion.yaml @@ -761,11 +761,10 @@ spec: name: MinIO Inc url: https://min.io relatedImages: - - image: quay.io/minio/operator@sha256:3ab501c476f269c4e4fc84017543ff7f6c8209ed474d77de472311472ba2e2ff - name: console - image: quay.io/minio/operator@sha256:3ab501c476f269c4e4fc84017543ff7f6c8209ed474d77de472311472ba2e2ff name: minio-operator - image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3 name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation + - image: quay.io/minio/operator@sha256:3ab501c476f269c4e4fc84017543ff7f6c8209ed474d77de472311472ba2e2ff + name: console version: 5.0.11 - replaces: minio-operator-rhmp.v5.0.10