Skip to content

Commit

Permalink
makefile: update makefile to add additional SA to csv
Browse files Browse the repository at this point in the history
Signed-off-by: Nitin Goyal <nigoyal@redhat.com>
  • Loading branch information
iamniting committed Aug 13, 2024
1 parent e5e648b commit ae839eb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
13 changes: 11 additions & 2 deletions Makefile.Downstream.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,22 @@ BUNDLE_CHANNELS := --channels=$(CHANNELS)
OPERATOR_SDK ?= $(LOCALBIN)/operator-sdk-$(OPERATOR_SDK_VERSION)
OPERATOR_SDK_VERSION ?= 1.34.1

NAME_PREFIX = ocscsi-

EXTRA_SERVICE_ACCOUNTS := '$(NAME_PREFIX)cephfs-ctrlplugin-sa,$(NAME_PREFIX)cephfs-nodeplugin-sa,$(NAME_PREFIX)rbd-ctrlplugin-sa,$(NAME_PREFIX)rbd-nodeplugin-sa'

.PHONY: bundle
bundle: kustomize operator-sdk manifests
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
cd config/manifests/bases && $(KUSTOMIZE) edit add annotation --force 'olm.skipRange':"$(SKIP_RANGE)"
rm -f config/manifests/kustomization.yaml
cd config/manifests && $(KUSTOMIZE) create --resources bases,../default --nameprefix $(NAME_PREFIX)
cd config/manifests && $(KUSTOMIZE) edit set image controller=$(IMG)
cd config/manifests && $(KUSTOMIZE) edit add patch --name controller-manager --kind Deployment --patch \
'[{"op": "add", "path": "/spec/template/spec/containers/1/env/-", "value": {"name":"CSI_SERVICE_ACCOUNT_PREFIX", "value":"$(NAME_PREFIX)"}}]'
rm -rf bundle
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle \
--overwrite --manifests --metadata --package $(PACKAGE_NAME) --version $(BUNDLE_VERSION) $(BUNDLE_METADATA_OPTS)
--overwrite --manifests --metadata --package $(PACKAGE_NAME) --version $(BUNDLE_VERSION) $(BUNDLE_METADATA_OPTS) \
--extra-service-accounts $(EXTRA_SERVICE_ACCOUNTS)

.PHONY: bundle-build
bundle-build: bundle ## Build the bundle image.
Expand Down
20 changes: 15 additions & 5 deletions config/manifests/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
---
# These resources constitute the fully configured set of manifests
# used to generate the 'manifests/' directory in a bundle.
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- bases
- ../default
- bases
- ../default
namePrefix: ocscsi-
images:
- name: controller
newName: quay.io/ocs-dev/cephcsi-operator
newTag: latest
patches:
- patch: '[{"op": "add", "path": "/spec/template/spec/containers/1/env/-", "value":
{"name":"CSI_SERVICE_ACCOUNT_PREFIX", "value":"ocscsi-"}}]'
target:
kind: Deployment
name: controller-manager

0 comments on commit ae839eb

Please sign in to comment.