Skip to content

Commit 7033ba4

Browse files
committed
bundle: Use kustomize to set the controller-manager images
1 parent 8ffc766 commit 7033ba4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ endif
367367
bundle: build manifests kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
368368
$(OPERATOR_SDK) generate kustomize manifests -q
369369
cd config/operator/deployment/ && $(KUSTOMIZE) edit set image controller=$(IMG) && \
370-
$(KUSTOMIZE) edit add patch --kind Deployment --name openstack-operator-controller-operator --namespace system --patch "[{\"op\": \"replace\", \"path\": \"/spec/template/spec/containers/0/env/0\", \"value\": {\"name\": \"OPENSTACK_RELEASE_VERSION\", \"value\": \"$(OPENSTACK_RELEASE_VERSION)\"}}]"
371-
sed -i -e 's|operator:image|$(IMG)|' config/operator/deployment/deployment.yaml
370+
$(KUSTOMIZE) edit add patch --kind Deployment --name openstack-operator-controller-operator --namespace system --patch "[{\"op\": \"replace\", \"path\": \"/spec/template/spec/containers/0/env/0\", \"value\": {\"name\": \"OPENSTACK_RELEASE_VERSION\", \"value\": \"$(OPENSTACK_RELEASE_VERSION)\"}}]" && \
371+
$(KUSTOMIZE) edit add patch --kind Deployment --name openstack-operator-controller-operator --namespace system --patch "[{\"op\": \"replace\", \"path\": \"/spec/template/spec/containers/0/env/1\", \"value\": {\"name\": \"OPERATOR_IMAGE_URL\", \"value\": \"$(IMG)\"}}]"
372372
$(KUSTOMIZE) build config/operator --load-restrictor='LoadRestrictionsNone' | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS)
373373
$(OPERATOR_SDK) bundle validate ./bundle
374374

config/operator/deployment/deployment.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ spec:
4242
args:
4343
- --leader-elect
4444
env:
45+
# we use kustomize to replace the first 2 envs here so do not reorder these
4546
- name: OPENSTACK_RELEASE_VERSION
4647
value: 0.0.1
47-
- name: ENABLE_WEBHOOKS
48-
value: false
4948
- name: OPERATOR_IMAGE_URL
5049
value: quay.io/openstack-k8s-operators/openstack-operator:latest
50+
- name: ENABLE_WEBHOOKS
51+
value: false
5152
image: controller:latest
5253
name: operator
5354
securityContext:

0 commit comments

Comments
 (0)