diff --git a/Makefile b/Makefile index 3ab1806..060c715 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,10 @@ # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) VERSION ?= 0.0.1 +# Creating the New CatalogSource requires publishing CSVs that replace one operator, +# but can skip several. This can be accomplished using the skipRange annotation: +SKIP_RANGE ?= + # 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: @@ -333,6 +337,9 @@ endif bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files. $(OPERATOR_SDK) generate kustomize manifests -q cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) + cd config/manifests/bases && $(KUSTOMIZE) edit add annotation --force 'olm.skipRange':"$(SKIP_RANGE)" + cd config/manifests/bases && $(KUSTOMIZE) edit add patch --name ceph-volsync-plugin-operator.v0.0.1 --kind ClusterServiceVersion\ + --patch '[{"op": "replace", "path": "/spec/replaces", "value": "$(REPLACES)"}]' $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) $(OPERATOR_SDK) bundle validate ./bundle diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index ad13e96..7106376 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization images: - name: controller - newName: controller - newTag: latest + newName: quay.io/ramendr/ceph-volsync-plugin-operator + newTag: v0.0.1 diff --git a/config/manifests/bases/kustomization.yaml b/config/manifests/bases/kustomization.yaml new file mode 100644 index 0000000..267265b --- /dev/null +++ b/config/manifests/bases/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ceph-volsync-plugin-operator.clusterserviceversion.yaml +commonAnnotations: + olm.skipRange: "" +patches: +- patch: '[{"op": "replace", "path": "/spec/replaces", "value": ""}]' + target: + kind: ClusterServiceVersion + name: ceph-volsync-plugin-operator.v0.0.1 diff --git a/config/manifests/kustomization.yaml b/config/manifests/kustomization.yaml index 362cbc4..1470c81 100644 --- a/config/manifests/kustomization.yaml +++ b/config/manifests/kustomization.yaml @@ -1,7 +1,7 @@ # These resources constitute the fully configured set of manifests # used to generate the 'manifests/' directory in a bundle. resources: -- bases/ceph-volsync-plugin-operator.clusterserviceversion.yaml +- bases - ../default - ../samples - ../scorecard