Skip to content

Commit 98cf977

Browse files
committed
Added Workflow job to update CFO image
1 parent 9c0cecc commit 98cf977

File tree

8 files changed

+28
-82
lines changed

8 files changed

+28
-82
lines changed

.github/workflows/tag-and-build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ jobs:
101101
sed -i -E "s/(.*MCAD_REF \?= ).*/\1release-\${MCAD_VERSION}/" Makefile
102102
sed -i -E "s/(.*INSTASCALE_VERSION \?= ).*/\1${{ github.event.inputs.instascale-version }}/" Makefile
103103
104+
- name: Update image version in params.env
105+
run: |
106+
VERSION=${{ github.event.inputs.version }} perl -i -pe 's/:(.*)$/:$ENV{"VERSION"}/' config/manager/params.env
107+
shell: bash
108+
104109
- name: Login to Quay.io
105110
uses: redhat-actions/podman-login@v1
106111
with:
@@ -146,7 +151,7 @@ jobs:
146151
uses: stefanzweifel/git-auto-commit-action@v4
147152
with:
148153
commit_message: Update dependency versions for release ${{ github.event.inputs.version }}
149-
file_pattern: 'README.md *.yaml Makefile go.mod go.sum'
154+
file_pattern: 'README.md *.yaml Makefile go.mod go.sum *.env'
150155
create_branch: true
151156
branch: ${{ env.PR_BRANCH_NAME }}
152157

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
198198

199199
.PHONY: deploy
200200
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
201-
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
201+
cd config/manager && IMAGE=$(IMG) perl -i -pe 's/odh-codeflare-operator-controller-image=(.*)$$/odh-codeflare-operator-controller-image=$$ENV{"IMAGE"}/' params.env
202202
$(KUSTOMIZE) build config/${ENV} | kubectl apply -f -
203203
git restore config/*
204204

config/manager/kustomization.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
resources:
22
- manager.yaml
33

4+
configMapGenerator:
5+
- name: codeflare-stack-config
6+
envs:
7+
- params.env
8+
configurations:
9+
- params.yaml
10+
11+
vars:
12+
- name: odh_codeflare_operator_controller_image
13+
objref:
14+
kind: ConfigMap
15+
name: codeflare-stack-config
16+
apiVersion: v1
17+
fieldref:
18+
fieldpath: data.odh-codeflare-operator-controller-image
19+
420
generatorOptions:
521
disableNameSuffixHash: true

config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ spec:
3434
containers:
3535
- command:
3636
- /manager
37-
image: controller:latest
37+
image: $(odh_codeflare_operator_controller_image)
3838
imagePullPolicy: Always
3939
name: manager
4040
securityContext:

config/manager/params.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
odh-codeflare-operator-controller-image=quay.io/project-codeflare/codeflare-operator:v1.0.1

config/manager/params.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
varReference:
2+
- path: spec/template/spec/containers[]/image
3+
kind: Deployment

config/manifests/bases/codeflare-operator.clusterserviceversion.yaml

Lines changed: 0 additions & 71 deletions
This file was deleted.

config/manifests/kustomization.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)