@@ -161,7 +161,7 @@ generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and
161161.PHONY : bindata
162162bindata : export LOCAL_BINARIES=$(LOCALBIN )
163163bindata : kustomize yq # # Call sync bindata script
164- mkdir -p bindata/crds bindata/rbac bindata/ operator
164+ mkdir -p bindata/crds bindata/operator
165165 $(KUSTOMIZE ) build config/crd > bindata/crds/crds.yaml
166166 $(KUSTOMIZE ) build config/default > bindata/operator/operator.yaml
167167 sed -i bindata/operator/operator.yaml -e " s|replicas:.*|replicas: {{ .OpenStackOperator.Deployment.Replicas }}|"
@@ -170,7 +170,6 @@ bindata: kustomize yq ## Call sync bindata script
170170 sed -i bindata/operator/operator.yaml -e " /customRequests/c\\ cpu: {{ .OpenStackOperator.Deployment.Manager.Resources.Requests.CPU }}\n memory: {{ .OpenStackOperator.Deployment.Manager.Resources.Requests.Memory }}"
171171 sed -i bindata/operator/operator.yaml -e " /customTolerations/c\\ tolerations:\n{{- range .OpenStackOperator.Deployment.Tolerations }}\n - key: \" {{ .Key }}\" \n{{- if .Operator }}\n operator: \" {{ .Operator }}\" \n{{- end }}\n{{- if .Value }}\n value: \" {{ .Value }}\" \n{{- end }}\n{{- if .Effect }}\n effect: \" {{ .Effect }}\" \n{{- end }}\n{{- if .TolerationSeconds }}\n tolerationSeconds: {{ .TolerationSeconds }}\n{{- end }}\n{{- end }}"
172172 cp config/operator/managers.yaml bindata/operator/
173- $(KUSTOMIZE ) build config/rbac > bindata/rbac/rbac.yaml
174173 /bin/bash hack/sync-bindata.sh
175174
176175.PHONY : fmt
@@ -406,11 +405,14 @@ bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metada
406405 $(KUSTOMIZE ) edit set image controller=$(IMG ) && \
407406 $(KUSTOMIZE ) edit add patch --kind Deployment --name openstack-operator-controller-init --namespace system --patch " [{\" op\" : \" replace\" , \" path\" : \" /spec/template/spec/containers/0/env/0\" , \" value\" : {\" name\" : \" OPENSTACK_RELEASE_VERSION\" , \" value\" : \" $( OPENSTACK_RELEASE_VERSION) \" }}]" && \
408407 $(KUSTOMIZE ) edit add patch --kind Deployment --name openstack-operator-controller-init --namespace system --patch " [{\" op\" : \" replace\" , \" path\" : \" /spec/template/spec/containers/0/env/1\" , \" value\" : {\" name\" : \" OPERATOR_IMAGE_URL\" , \" value\" : \" $( IMG) \" }}]"
408+ rm -rf bundle/manifests bundle/metadata
409409 $(KUSTOMIZE ) build config/operator --load-restrictor=' LoadRestrictionsNone' | $(OPERATOR_SDK ) generate bundle $(BUNDLE_GEN_FLAGS )
410410ifneq ($(REPLACES ) ,)
411411 @echo "Adding replaces: $(REPLACES) to CSV"
412412 sed -i "/^ name: openstack-operator.v$(VERSION)/a\ replaces: $(REPLACES)" bundle/manifests/openstack-operator.clusterserviceversion.yaml
413413endif
414+ @echo "Staging service operator RBAC into bundle manifests"
415+ cp config/operator/bundle-rbac/*.yaml bundle/manifests/
414416 $(OPERATOR_SDK) bundle validate ./bundle
415417
416418.PHONY : bundle-build
0 commit comments