Skip to content

Commit

Permalink
makefile: create seperate dependencies bundle
Browse files Browse the repository at this point in the history
Signed-off-by: Nitin Goyal <[email protected]>
  • Loading branch information
iamniting committed Oct 22, 2024
1 parent e36dd67 commit 524c2a8
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ IMAGE_TAG_BASE ?= $(IMAGE_REGISTRY)/$(REGISTRY_NAMESPACE)/odf-operator
# BUNDLE_IMG defines the image:tag used for the bundle.
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:$(IMAGE_TAG)
BUNDLE_IMG_DEPS ?= $(IMAGE_TAG_BASE)-deps-bundle:$(IMAGE_TAG)

# BUNDLE_GEN_FLAGS are the flags passed to the operator-sdk generate bundle command
BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
Expand Down Expand Up @@ -268,6 +269,14 @@ endif

.PHONY: bundle
bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
# Dependencies bundle
$(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) \
--kustomize-dir config/bundles --input-dir config/bundles --output-dir bundle-deps --package odf-operator-deps
@cp config/bundles/dependencies.yaml bundle-deps/metadata/
$(OPERATOR_SDK) bundle validate bundle-deps
@cp bundle.Dockerfile bundle.deps.Dockerfile

# Main odf-operator bundle
$(OPERATOR_SDK) generate kustomize manifests -q
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS)
Expand All @@ -276,10 +285,12 @@ bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metada
.PHONY: bundle-build
bundle-build: ## Build the bundle image.
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) .
docker build -f bundle.deps.Dockerfile -t $(BUNDLE_IMG_DEPS) .

.PHONY: bundle-push
bundle-push: ## Push the bundle image.
$(MAKE) docker-push IMG=$(BUNDLE_IMG)
$(MAKE) docker-push IMG=$(BUNDLE_IMG_DEPS)

.PHONY: opm
OPM = $(LOCALBIN)/opm
Expand Down
40 changes: 40 additions & 0 deletions config/bundles/csv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
annotations:
operatorframework.io/suggested-namespace: openshift-storage
operators.operatorframework.io/operator-type: non-standalone
labels:
operatorframework.io/arch.amd64: supported
operatorframework.io/arch.ppc64le: supported
operatorframework.io/arch.s390x: supported
name: odf-operator-deps.v0.0.0
namespace: placeholder
spec:
apiservicedefinitions: {}
description: |
deploys dependencies.
displayName: Data Foundation Dependencies
icon:
- base64data: PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOTIgMTQ1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2UwMDt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPlJlZEhhdC1Mb2dvLUhhdC1Db2xvcjwvdGl0bGU+PHBhdGggZD0iTTE1Ny43Nyw2Mi42MWExNCwxNCwwLDAsMSwuMzEsMy40MmMwLDE0Ljg4LTE4LjEsMTcuNDYtMzAuNjEsMTcuNDZDNzguODMsODMuNDksNDIuNTMsNTMuMjYsNDIuNTMsNDRhNi40Myw2LjQzLDAsMCwxLC4yMi0xLjk0bC0zLjY2LDkuMDZhMTguNDUsMTguNDUsMCwwLDAtMS41MSw3LjMzYzAsMTguMTEsNDEsNDUuNDgsODcuNzQsNDUuNDgsMjAuNjksMCwzNi40My03Ljc2LDM2LjQzLTIxLjc3LDAtMS4wOCwwLTEuOTQtMS43My0xMC4xM1oiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xMjcuNDcsODMuNDljMTIuNTEsMCwzMC42MS0yLjU4LDMwLjYxLTE3LjQ2YTE0LDE0LDAsMCwwLS4zMS0zLjQybC03LjQ1LTMyLjM2Yy0xLjcyLTcuMTItMy4yMy0xMC4zNS0xNS43My0xNi42QzEyNC44OSw4LjY5LDEwMy43Ni41LDk3LjUxLjUsOTEuNjkuNSw5MCw4LDgzLjA2LDhjLTYuNjgsMC0xMS42NC01LjYtMTcuODktNS42LTYsMC05LjkxLDQuMDktMTIuOTMsMTIuNSwwLDAtOC40MSwyMy43Mi05LjQ5LDI3LjE2QTYuNDMsNi40MywwLDAsMCw0Mi41Myw0NGMwLDkuMjIsMzYuMywzOS40NSw4NC45NCwzOS40NU0xNjAsNzIuMDdjMS43Myw4LjE5LDEuNzMsOS4wNSwxLjczLDEwLjEzLDAsMTQtMTUuNzQsMjEuNzctMzYuNDMsMjEuNzdDNzguNTQsMTA0LDM3LjU4LDc2LjYsMzcuNTgsNTguNDlhMTguNDUsMTguNDUsMCwwLDEsMS41MS03LjMzQzIyLjI3LDUyLC41LDU1LC41LDc0LjIyYzAsMzEuNDgsNzQuNTksNzAuMjgsMTMzLjY1LDcwLjI4LDQ1LjI4LDAsNTYuNy0yMC40OCw1Ni43LTM2LjY1LDAtMTIuNzItMTEtMjcuMTYtMzAuODMtMzUuNzgiLz48L3N2Zz4=
mediatype: image/svg+xml
installModes:
- supported: true
type: OwnNamespace
- supported: true
type: SingleNamespace
- supported: false
type: MultiNamespace
- supported: false
type: AllNamespaces
links:
- name: Source Code
url: https://github.com/red-hat-storage/odf-operator
maintainers:
- email: [email protected]
name: Red Hat Support
maturity: alpha
minKubeVersion: 1.16.0
provider:
name: Red Hat
version: 0.0.0
29 changes: 29 additions & 0 deletions config/bundles/dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
dependencies:
- type: olm.package
value:
packageName: ocs-operator
version: ">=4.16.0 <=4.17.0"
- type: olm.package
value:
packageName: rook-ceph-operator
version: ">=4.16.0 <=4.17.0"
- type: olm.package
value:
packageName: ocs-client-operator
version: ">=4.16.0 <=4.17.0"
- type: olm.package
value:
packageName: mcg-operator
version: ">=4.16.0 <=4.17.0"
- type: olm.package
value:
packageName: odf-csi-addons-operator
version: ">=4.16.0 <=4.17.0"
- type: olm.package
value:
packageName: odf-prometheus-operator
version: ">=4.16.0 <=4.17.0"
- type: olm.package
value:
packageName: recipe
version: ">=4.16.0 <=4.17.0"
4 changes: 4 additions & 0 deletions config/bundles/extended-dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- type: olm.package
value:
packageName: ibm-storage-odf-operator
version: "1.6.0"
2 changes: 2 additions & 0 deletions config/bundles/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
resources:
- csv.yaml

0 comments on commit 524c2a8

Please sign in to comment.