Skip to content

Commit ddf9cbf

Browse files
committed
[CI] Remove replace version in OLM
The current logic is brittle, and it is guaranteed to break after we release 2.10.0. The problem with `ls -1v` is that it lists in alphabetical order, not in semver order. That means that a list with 2.1.0, 2.9.0, 2.10.0 and 2.11.0 would be listed as: 2.1.0 2.10.0 2.11.0 2.9.0 The previous logic would always yield 2.9.0 (bottom) as the replace version. That is not correct for 2.11.0. The opm validator does not complain by not providing a "replaces" version, so it may just be fine and OLM may have some magic sauce to figure out what version to upgrade to. [skip ci]
1 parent 3ae6730 commit ddf9cbf

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

Diff for: .github/workflows/testing_and_publishing_OLM_bundle.yml

-4
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,7 @@ jobs:
215215
git branch rabbitmq-cluster-operator-$BUNDLE_VERSION
216216
git checkout rabbitmq-cluster-operator-$BUNDLE_VERSION
217217
218-
REPLACE_VERSION=$(ls -1v | tail -2 | head -1)
219218
cp -v -fR olm-package-ci/"$BUNDLE_VERSION" ./operators/rabbitmq-cluster-operator/
220-
sed -i -e "s/replaces: null/replaces: rabbitmq-cluster-operator.v$REPLACE_VERSION/g" ./operators/rabbitmq-cluster-operator/$BUNDLE_VERSION/manifests/rabbitmq.clusterserviceversion.yaml
221219
sed -i -e "s/latest/$BUNDLE_VERSION/g" ./operators/rabbitmq-cluster-operator/$BUNDLE_VERSION/manifests/rabbitmq.clusterserviceversion.yaml
222220
git add operators/rabbitmq-cluster-operator
223221
git commit -s -m "RabbitMQ Operator release $BUNDLE_VERSION"
@@ -253,9 +251,7 @@ jobs:
253251
git branch rabbitmq-cluster-operator-$BUNDLE_VERSION
254252
git checkout rabbitmq-cluster-operator-$BUNDLE_VERSION
255253
256-
REPLACE_VERSION=$(ls -1v | tail -2 | head -1)
257254
cp -v -fR olm-package-ci/"$BUNDLE_VERSION-openshift" ./operators/rabbitmq-cluster-operator/"$BUNDLE_VERSION"
258-
sed -i -e "s/replaces: null/replaces: rabbitmq-cluster-operator.v$REPLACE_VERSION/g" ./operators/rabbitmq-cluster-operator/"$BUNDLE_VERSION"/manifests/rabbitmq.clusterserviceversion.yaml
259255
sed -i -e "s/latest/$BUNDLE_VERSION/g" ./operators/rabbitmq-cluster-operator/"$BUNDLE_VERSION"/manifests/rabbitmq.clusterserviceversion.yaml
260256
git add operators/rabbitmq-cluster-operator
261257
git commit -s -m "RabbitMQ Operator release $BUNDLE_VERSION"

Diff for: scripts/print-tag-version.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ if [ "$GITHUB_REF_TYPE" != "tag" ]; then
55
exit 0
66
fi
77

8-
printf "BUNDLE_VERSION=%s\n" "$GITHUB_REF_NAME"
8+
printf "BUNDLE_VERSION=%s\n" "${GITHUB_REF_NAME:1}"

0 commit comments

Comments
 (0)