diff --git a/Makefile b/Makefile index 9b820d915..00e2ae20c 100644 --- a/Makefile +++ b/Makefile @@ -109,6 +109,9 @@ bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metada $(KUSTOMIZE) edit add patch --name ocs-client-operator.v0.0.0 --kind ClusterServiceVersion\ --patch '[{"op": "replace", "path": "/spec/replaces", "value": "$(REPLACES)"}]' $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) + sed -i "s|packageName:.*|packageName: ${CSI_ADDONS_PACKAGE_NAME}|g" "config/metadata/dependencies.yaml" + sed -i "s|version:.*|version: "${CSI_ADDONS_PACKAGE_VERSION}"|g" "config/metadata/dependencies.yaml" + cp config/metadata/* bundle/metadata/ $(OPERATOR_SDK) bundle validate ./bundle .PHONY: bundle-build diff --git a/bundle/metadata/dependencies.yaml b/bundle/metadata/dependencies.yaml new file mode 100644 index 000000000..dcfeb21fa --- /dev/null +++ b/bundle/metadata/dependencies.yaml @@ -0,0 +1,5 @@ +dependencies: +- type: olm.package + value: + packageName: csi-addons + version: 0.5.0 diff --git a/config/metadata/dependencies.yaml b/config/metadata/dependencies.yaml new file mode 100644 index 000000000..dcfeb21fa --- /dev/null +++ b/config/metadata/dependencies.yaml @@ -0,0 +1,5 @@ +dependencies: +- type: olm.package + value: + packageName: csi-addons + version: 0.5.0 diff --git a/hack/make-bundle-vars.mk b/hack/make-bundle-vars.mk index 5b22d128f..66cd27b86 100644 --- a/hack/make-bundle-vars.mk +++ b/hack/make-bundle-vars.mk @@ -36,9 +36,12 @@ SKIP_RANGE ?= # Image URL to use all building/pushing image targets IMAGE_REGISTRY ?= quay.io REGISTRY_NAMESPACE ?= ocs-dev +CSI_ADDONS_REGISTRY_NAMESPACE ?= csiaddons IMAGE_TAG ?= latest IMAGE_NAME ?= ocs-client-operator BUNDLE_IMAGE_NAME ?= $(IMAGE_NAME)-bundle +CSI_ADDONS_BUNDLE_IMAGE_NAME ?= k8s-bundle +CSI_ADDONS_BUNDLE_IMAGE_TAG ?= v0.5.0 CATALOG_IMAGE_NAME ?= $(IMAGE_NAME)-catalog # IMG defines the image used for the operator. @@ -47,6 +50,9 @@ IMG ?= $(IMAGE_REGISTRY)/$(REGISTRY_NAMESPACE)/$(IMAGE_NAME):$(IMAGE_TAG) # BUNDLE_IMG defines the image used for the bundle. BUNDLE_IMG ?= $(IMAGE_REGISTRY)/$(REGISTRY_NAMESPACE)/$(BUNDLE_IMAGE_NAME):$(IMAGE_TAG) +CSI_ADDONS_BUNDLE_IMG ?= $(IMAGE_REGISTRY)/$(CSI_ADDONS_REGISTRY_NAMESPACE)/$(CSI_ADDONS_BUNDLE_IMAGE_NAME):$(CSI_ADDONS_BUNDLE_IMAGE_TAG) + + # CATALOG_IMG defines the image used for the catalog. CATALOG_IMG ?= $(IMAGE_REGISTRY)/$(REGISTRY_NAMESPACE)/$(CATALOG_IMAGE_NAME):$(IMAGE_TAG) @@ -55,7 +61,7 @@ CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false" # A comma-separated list of bundle images (e.g. make catalog-build BUNDLE_IMGS=example.com/operator-bundle:v0.1.0,example.com/operator-bundle:v0.2.0). # These images MUST exist in a registry and be pull-able. -BUNDLE_IMGS ?= $(shell echo $(BUNDLE_IMG) | sed "s/ /,/g") +BUNDLE_IMGS ?= $(shell echo $(BUNDLE_IMG) $(CSI_ADDONS_BUNDLE_IMG) | sed "s/ /,/g") # Set CATALOG_BASE_IMG to an existing catalog image tag to add $BUNDLE_IMGS to that image. ifneq ($(origin CATALOG_BASE_IMG), undefined) @@ -76,3 +82,7 @@ ifeq ($(CLUSTER_ENV), openshift) else ifeq ($(CLUSTER_ENV), kubernetes) RBAC_PROXY_IMG ?= $(KUBE_RBAC_PROXY_IMG) endif + +# csi-addons dependencies +CSI_ADDONS_PACKAGE_NAME ?= csi-addons +CSI_ADDONS_PACKAGE_VERSION ?= "0.5.0"