Skip to content

Commit

Permalink
Added Workflow job to update CFO image
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobbins228 committed Nov 16, 2023
1 parent 9c0cecc commit 98cf977
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 82 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/tag-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ jobs:
sed -i -E "s/(.*MCAD_REF \?= ).*/\1release-\${MCAD_VERSION}/" Makefile
sed -i -E "s/(.*INSTASCALE_VERSION \?= ).*/\1${{ github.event.inputs.instascale-version }}/" Makefile
- name: Update image version in params.env
run: |
VERSION=${{ github.event.inputs.version }} perl -i -pe 's/:(.*)$/:$ENV{"VERSION"}/' config/manager/params.env
shell: bash

- name: Login to Quay.io
uses: redhat-actions/podman-login@v1
with:
Expand Down Expand Up @@ -146,7 +151,7 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update dependency versions for release ${{ github.event.inputs.version }}
file_pattern: 'README.md *.yaml Makefile go.mod go.sum'
file_pattern: 'README.md *.yaml Makefile go.mod go.sum *.env'
create_branch: true
branch: ${{ env.PR_BRANCH_NAME }}

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified

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

Expand Down
16 changes: 16 additions & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
resources:
- manager.yaml

configMapGenerator:
- name: codeflare-stack-config
envs:
- params.env
configurations:
- params.yaml

vars:
- name: odh_codeflare_operator_controller_image
objref:
kind: ConfigMap
name: codeflare-stack-config
apiVersion: v1
fieldref:
fieldpath: data.odh-codeflare-operator-controller-image

generatorOptions:
disableNameSuffixHash: true
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
containers:
- command:
- /manager
image: controller:latest
image: $(odh_codeflare_operator_controller_image)
imagePullPolicy: Always
name: manager
securityContext:
Expand Down
1 change: 1 addition & 0 deletions config/manager/params.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
odh-codeflare-operator-controller-image=quay.io/project-codeflare/codeflare-operator:v1.0.1
3 changes: 3 additions & 0 deletions config/manager/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
varReference:
- path: spec/template/spec/containers[]/image
kind: Deployment

This file was deleted.

8 changes: 0 additions & 8 deletions config/manifests/kustomization.yaml

This file was deleted.

0 comments on commit 98cf977

Please sign in to comment.