Skip to content

Commit

Permalink
add 'replaces' to csv
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Shitrit <[email protected]>
  • Loading branch information
mshitrit committed Nov 29, 2023
1 parent af1bfc6 commit 2e5dcd0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,17 @@ bundle-community-k8s: bundle-community ## Generate bundle manifests and metadata
bundle-community: bundle ##Add Community Edition suffix to operator name
sed -r -i "s|displayName: Self Node Remediation Operator.*|displayName: Self Node Remediation Operator - Community Edition|;" ${BUNDLE_CSV}

# Split the VERSION into major, minor, and patch parts
MAJOR := $(word 1, $(subst ., ,$(VERSION)))
MINOR := $(word 2, $(subst ., ,$(VERSION)))
PATCH := $(word 3, $(subst ., ,$(VERSION)))

# Subtract 1 from the MINOR part
NEW_MINOR := $(shell echo $$(($(MINOR) - 1)))

# Recreate the DEC_VERSION variable
DEC_VERSION := $(MAJOR).$(NEW_MINOR).$(PATCH)

.PHONY: bundle-update
bundle-update: ## Update containerImage, createdAt, skipRange, and icon fields in the bundle's CSV, then validate the bundle directory
# update container image in the metadata
Expand All @@ -299,6 +310,8 @@ bundle-update: ## Update containerImage, createdAt, skipRange, and icon fields i
sed -r -i "s|createdAt: \".*\"|createdAt: \"`date "+%Y-%m-%d %T" `\"|;" ${BUNDLE_CSV}
# set skipRange
sed -r -i "s|olm.skipRange: .*|olm.skipRange: '>=0.4.0 <${VERSION}'|;" ${BUNDLE_CSV}
# set replaces
sed -r -i "s|replaces: .*|replaces: self-node-remediation.v${DEC_VERSION}|;" ${BUNDLE_CSV}
# set icon (not version or build date related, but just to not having this huge data permanently in the CSV)
sed -r -i "s|base64data:.*|base64data: ${ICON_BASE64}|;" ${BUNDLE_CSV}
$(MAKE) bundle-validate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ spec:
provider:
name: Medik8s
url: https://www.medik8s.io/
replaces: self-node-remediation.v0.0.0
version: 0.0.1
webhookdefinitions:
- admissionReviewVersions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,5 @@ spec:
provider:
name: Medik8s
url: https://www.medik8s.io/
replaces: self-node-remediation.v0.0.0
version: 0.0.0

0 comments on commit 2e5dcd0

Please sign in to comment.