From 26da2ebf8c15155a3a6eea1d48901d2f61a76f09 Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Wed, 14 Jun 2023 18:33:06 +0200 Subject: [PATCH] Add MCAD version variable --- Makefile | 5 +++++ config/crd/mcad/kustomization.yaml | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d5ce65fdc..ba341744c 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,9 @@ VERSION ?= 0.0.0-dev # INSTASCALE_VERSION defines the default version of the InstaScale controller INSTASCALE_VERSION ?= v0.0.4 +# MCAD_VERSION defines the default version of the MCAD controller +MCAD_VERSION ?= v1.31.0 + # CHANNELS define the bundle channels used in the bundle. # Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable") # To re-generate a bundle for other specific channels without changing the standard setup, you can: @@ -168,6 +171,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. + $(KUSTOMIZE) fn run config/crd/mcad --image gcr.io/kpt-fn/apply-setters:v0.2.0 -- MCAD_VERSION=$(MCAD_VERSION) cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} $(KUSTOMIZE) build config/default | kubectl apply -f - git restore config/* @@ -237,6 +241,7 @@ validate-bundle: install-operator-sdk .PHONY: bundle bundle: defaults manifests kustomize install-operator-sdk ## Generate bundle manifests and metadata, then validate generated files. $(OPERATOR_SDK) generate kustomize manifests -q + $(KUSTOMIZE) fn run config/crd/mcad --image gcr.io/kpt-fn/apply-setters:v0.2.0 -- MCAD_VERSION=$(MCAD_VERSION) 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.v$(PREVIOUS_VERSION)" }]' --kind ClusterServiceVersion diff --git a/config/crd/mcad/kustomization.yaml b/config/crd/mcad/kustomization.yaml index 1474b25fc..14292a9a6 100644 --- a/config/crd/mcad/kustomization.yaml +++ b/config/crd/mcad/kustomization.yaml @@ -1,2 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization resources: - - github.com/project-codeflare/multi-cluster-app-dispatcher/config/crd?ref=release-v1.31.0 +- github.com/project-codeflare/multi-cluster-app-dispatcher/config/crd?ref=release-v0.0.0 # kpt-set: github.com/project-codeflare/multi-cluster-app-dispatcher/config/crd?ref=release-${MCAD_VERSION}