Skip to content

Added Workflow job to update CFO image #398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/tag-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ jobs:
sed -i -E "s/(.*INSTASCALE_VERSION \?= ).*/\1${{ github.event.inputs.instascale-version }}/" Makefile
sed -i -E "s/(.*KUBERAY_VERSION \?= ).*/\1${{ github.event.inputs.kuberay-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 @@ -134,7 +139,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
7 changes: 2 additions & 5 deletions 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 Expand Up @@ -283,10 +283,7 @@ validate-bundle: install-operator-sdk

.PHONY: bundle
bundle: manifests kustomize install-operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
$(OPERATOR_SDK) generate kustomize manifests -q
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
cd config/manifests && $(KUSTOMIZE) edit add patch --patch '[{"op":"add", "path":"/metadata/annotations/containerImage", "value": "$(IMG)" }]' --kind ClusterServiceVersion
cd config/manifests && $(KUSTOMIZE) edit add patch --patch '[{"op":"add", "path":"/spec/replaces", "value": "codeflare-operator.$(PREVIOUS_VERSION)" }]' --kind ClusterServiceVersion
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/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS)
$(MAKE) validate-bundle
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
Expand Up @@ -3,3 +3,19 @@ resources:

generatorOptions:
disableNameSuffixHash: true

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
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/opendatahub/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
3 changes: 2 additions & 1 deletion config/manifests/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# These resources constitute the fully configured set of manifests
# used to generate the 'manifests/' directory in a bundle.
resources:
- bases/codeflare-operator.clusterserviceversion.yaml
- ../default
- ../scorecard
- codeflare-operator.clusterserviceversion.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization