Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/sync-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ jobs:
regex: false
exclude: .github/**

- name: Update REPLACES to current version
run: |
current_replaces=$(grep -E '^REPLACES' Makefile | awk -F'=' '{ print $2 }' | xargs)
current_version=$(grep -E '^VERSION' Makefile | awk '{ print $3 }')
echo "Current REPLACES: $current_replaces"
echo "Will set REPLACES to: nginx-ingress-operator.v$current_version"
sed -i "s|^REPLACES ?= .*|REPLACES ?= nginx-ingress-operator.v$current_version|" Makefile
- name: Find and Replace Operator version
uses: jacobtomlinson/gha-find-replace@f1069b438f125e5395d84d1c6fd3b559a7880cb5 # v3.0.5
with:
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 3.3.1

# REPLACES defines the operator version that this version replaces for upgrades (OLM path).
# Set to empty to disable (e.g make bundle REPLACES=)
REPLACES ?= nginx-ingress-operator.v3.2.3

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
Expand Down Expand Up @@ -211,6 +215,14 @@ bundle: kustomize operator-sdk ## Generate bundle manifests and metadata, then v
cd config/default && $(KUSTOMIZE) edit set image kube-rbac-proxy=$(KRP_IMAGE_BASE):$(KRP_IMAGE_VERSION)
if [ -n "$(IMAGE_PULL_SECRET_NAME)" ]; then cd config/default && $(KUSTOMIZE) edit add patch --kind Deployment --group apps --version v1 --name controller-manager --patch '${image_pull_secrets_patch}'; fi
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS)
@if [ -n "$(REPLACES)" ]; then \
echo "Adding replaces: $(REPLACES) to ClusterServiceVersion"; \
sed -i.bak '/^ provider:/{h;s/.*/ replaces: $(REPLACES)/;p;x;}' bundle/manifests/nginx-ingress-operator.clusterserviceversion.yaml && \
rm -f bundle/manifests/nginx-ingress-operator.clusterserviceversion.yaml.bak; \
fi
@echo "Adding skips: [] to ClusterServiceVersion"; \
sed -i.bak '/^ version:/{h;s/.*/ skips: []/;p;x;}' bundle/manifests/nginx-ingress-operator.clusterserviceversion.yaml && \
rm -f bundle/manifests/nginx-ingress-operator.clusterserviceversion.yaml.bak
@printf "%s\n" '' 'LABEL com.redhat.openshift.versions="$(OPENSHIFT_VERSION)"' 'LABEL com.redhat.delivery.operator.bundle=true' 'LABEL com.redhat.delivery.backport=true' >> bundle.Dockerfile
@printf "%s\n" '' ' # OpenShift annotations.' ' com.redhat.openshift.versions: $(OPENSHIFT_VERSION)' >> bundle/metadata/annotations.yaml
$(OPERATOR_SDK) bundle validate ./bundle
Expand Down