Skip to content

Commit

Permalink
Merge pull request #155 from infrawatch/migarcia-bundle-spec-replaces
Browse files Browse the repository at this point in the history
Add optional spec.replaces field to CSV for update graph compliance
  • Loading branch information
compi-migui authored Jan 5, 2024
2 parents 7e586c8 + b1097ed commit 1932052
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build/generate_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ generate_bundle() {
${OPERATOR_SDK} generate bundle --channels ${BUNDLE_CHANNELS} --default-channel ${BUNDLE_DEFAULT_CHANNEL} --manifests --metadata --version "${OPERATOR_BUNDLE_VERSION}" --output-dir "${WORKING_DIR}" >> ${LOGFILE} 2>&1
popd > /dev/null 2>&1

# CSVs without a spec.replaces field are valid, so fall back to those if
# latest released version is unknown.
# Placeholder value is validated by operator-sdk during local bundle
# generation and so needs to conform to RFC1123.
if [[ -n "$BUNDLE_LATEST_RELEASED_VERSION" ]]; then
REPLACE_REGEX="$REPLACE_REGEX;s#---bundle-latest-released-version#${BUNDLE_LATEST_RELEASED_VERSION}#g"
else sed -i '/---bundle-latest-released-version/d' "${WORKING_DIR}/manifests/${OPERATOR_NAME}.clusterserviceversion.yaml"
fi

sed -i -E "${REPLACE_REGEX}" "${WORKING_DIR}/manifests/${OPERATOR_NAME}.clusterserviceversion.yaml"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,5 @@ spec:
selector:
matchLabels:
name: smart-gateway-operator
replaces: smart-gateway-operator.v---bundle-latest-released-version
version: 1.99.0

0 comments on commit 1932052

Please sign in to comment.