|
5 | 5 | # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) |
6 | 6 | VERSION ?= 3.3.1 |
7 | 7 |
|
| 8 | +# REPLACES defines the operator version that this version replaces for upgrades (OLM path). |
| 9 | +# Set to empty to disable (e.g make bundle REPLACES=) |
| 10 | +REPLACES ?= nginx-ingress-operator.v3.2.3 |
| 11 | + |
8 | 12 | # CHANNELS define the bundle channels used in the bundle. |
9 | 13 | # Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable") |
10 | 14 | # To re-generate a bundle for other specific channels without changing the standard setup, you can: |
@@ -211,6 +215,14 @@ bundle: kustomize operator-sdk ## Generate bundle manifests and metadata, then v |
211 | 215 | cd config/default && $(KUSTOMIZE) edit set image kube-rbac-proxy=$(KRP_IMAGE_BASE):$(KRP_IMAGE_VERSION) |
212 | 216 | 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 |
213 | 217 | $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) |
| 218 | + @if [ -n "$(REPLACES)" ]; then \ |
| 219 | + echo "Adding replaces: $(REPLACES) to ClusterServiceVersion"; \ |
| 220 | + sed -i.bak '/^ provider:/{h;s/.*/ replaces: $(REPLACES)/;p;x;}' bundle/manifests/nginx-ingress-operator.clusterserviceversion.yaml && \ |
| 221 | + rm -f bundle/manifests/nginx-ingress-operator.clusterserviceversion.yaml.bak; \ |
| 222 | + fi |
| 223 | + @echo "Adding skips: [] to ClusterServiceVersion"; \ |
| 224 | + sed -i.bak '/^ version:/{h;s/.*/ skips: []/;p;x;}' bundle/manifests/nginx-ingress-operator.clusterserviceversion.yaml && \ |
| 225 | + rm -f bundle/manifests/nginx-ingress-operator.clusterserviceversion.yaml.bak |
214 | 226 | @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 |
215 | 227 | @printf "%s\n" '' ' # OpenShift annotations.' ' com.redhat.openshift.versions: $(OPENSHIFT_VERSION)' >> bundle/metadata/annotations.yaml |
216 | 228 | $(OPERATOR_SDK) bundle validate ./bundle |
|
0 commit comments