Skip to content

Commit

Permalink
To provide upgrade channel for Operator
Browse files Browse the repository at this point in the history
  • Loading branch information
cniackz committed Apr 17, 2023
1 parent 4e436e5 commit b4d1368
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions olm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ for catalog in "${redhatCatalogs[@]}"; do
yq -i eval 'del(.spec.install.spec.deployments[1].spec.template.spec.containers[0].securityContext.runAsGroup)' bundles/$catalog/$RELEASE/manifests/$package.clusterserviceversion.yaml
yq -i eval 'del(.spec.install.spec.deployments[1].spec.template.spec.containers[0].securityContext.runAsUser)' 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 channel for upgrading Operator..."
yq -i e '.metadata.annotations."olm.skipRange" |= "putversionrangehere"' bundles/$catalog/$RELEASE/manifests/$package.clusterserviceversion.yaml
rm -rf tmp.yaml
sed "s/putversionrangehere/'>=4.4.16 <${RELEASE}'/g" bundles/$catalog/$RELEASE/manifests/$package.clusterserviceversion.yaml > tmp.yaml
rm bundles/$catalog/$RELEASE/manifests/$package.clusterserviceversion.yaml
mv tmp.yaml bundles/$catalog/$RELEASE/manifests/$package.clusterserviceversion.yaml

# In order to deploy via OLM, we should let OLM to decide on the security
# context; otherwise deploy will fail and operator update will not be possible
# already tested this manually to prove the point:
Expand Down

0 comments on commit b4d1368

Please sign in to comment.