From 1b10b0c9cd0d021c52fd32d31eda2bee9659b964 Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 9 Jun 2023 10:36:26 -0400 Subject: [PATCH 1/4] change the default versions to be clearly placeholders Signed-off-by: Kevin --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ffbcf3905..215bdefb8 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,8 @@ # best if we could detect this. If we cannot, we need to document it somewhere. # then we can add a patch in the `PHONY: bundle` -PREVIOUS_VERSION ?= 0.0.3 -VERSION ?= 0.0.4 +PREVIOUS_VERSION ?= 0.0.0-dev +VERSION ?= 0.0.0-dev # INSTASCALE_VERSION defines the default version of the InstaScale controller INSTASCALE_VERSION ?= v0.0.4 From ce67631c5154e3a9703fd2b01ac5691dd960d510 Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 9 Jun 2023 10:53:12 -0400 Subject: [PATCH 2/4] update contributing guidelines with build info Signed-off-by: Kevin --- CONTRIBUTING.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e74b783d..ff3ff8e4e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,14 +31,21 @@ If changes are made to any Go code (like in the `controllers` dir for example), - This will check and build/compile the modified code For building and pushing a new version of the operator image: - - `make image-build -e IMG=` - - `make image-push -e IMG` + - `make image-build -e IMG_TAG_BASE= VERSION=` + - `make image-push -e IMG_TAG_BASE= VERSION=` For deploying onto a cluster: - First, either set `KUBECONFIG` or ensure you are logged into a cluster in your environment - `make install` - `make deploy -e IMG=` +For building and pushing a new version of the bundled operator image: + - `make bundle-build -e IMG_TAG_BASE= VERSION= PREVIOUS_VERSION=` + - `make bundle-push -e IMG_TAG_BASE= VERSION= PREVIOUS_VERSION=` + +To create a new openshift-community-operator-release: + - `make openshift-community-operator-release -e IMG_TAG_BASE= VERSION= PREVIOUS_VERSION=` + ## Testing The CodeFlare Operator currently has unit tests and pre-commit checks - To enable and view pre-commit checks: `pre-commit install` From 4e908e3267b7eb1c1b8d7da5312464d96d21476a Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 9 Jun 2023 11:12:10 -0400 Subject: [PATCH 3/4] remove patches which are generated during bundle build Signed-off-by: Kevin --- config/manager/kustomization.yaml | 4 ---- config/manifests/kustomization.yaml | 7 ------- 2 files changed, 11 deletions(-) diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 145fc38d9..538c69f29 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -10,7 +10,3 @@ configMapGenerator: name: manager-config apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -images: -- name: controller - newName: quay.io/project-codeflare/codeflare-operator - newTag: v0.0.2 diff --git a/config/manifests/kustomization.yaml b/config/manifests/kustomization.yaml index ad366f2ef..954c255a0 100644 --- a/config/manifests/kustomization.yaml +++ b/config/manifests/kustomization.yaml @@ -7,10 +7,3 @@ resources: - ../scorecard apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -patches: -- patch: '[{"op":"add", "path":"/metadata/annotations/containerImage", "value": "quay.io/project-codeflare/codeflare-operator:v0.0.1" }]' - target: - kind: ClusterServiceVersion -- patch: '[{"op":"add", "path":"/metadata/annotations/containerImage", "value": "quay.io/project-codeflare/codeflare-operator:v0.0.2" }]' - target: - kind: ClusterServiceVersion From 44a4696bb816ce51cd8c1bd0527de40155479723 Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 9 Jun 2023 11:13:36 -0400 Subject: [PATCH 4/4] restore config directory after building bundle Signed-off-by: Kevin --- CONTRIBUTING.md | 10 +++++----- Makefile | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ff3ff8e4e..85d98b387 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,8 +31,8 @@ If changes are made to any Go code (like in the `controllers` dir for example), - This will check and build/compile the modified code For building and pushing a new version of the operator image: - - `make image-build -e IMG_TAG_BASE= VERSION=` - - `make image-push -e IMG_TAG_BASE= VERSION=` + - `make image-build -e IMAGE_TAG_BASE= VERSION=` + - `make image-push -e IMAGE_TAG_BASE= VERSION=` For deploying onto a cluster: - First, either set `KUBECONFIG` or ensure you are logged into a cluster in your environment @@ -40,11 +40,11 @@ For deploying onto a cluster: - `make deploy -e IMG=` For building and pushing a new version of the bundled operator image: - - `make bundle-build -e IMG_TAG_BASE= VERSION= PREVIOUS_VERSION=` - - `make bundle-push -e IMG_TAG_BASE= VERSION= PREVIOUS_VERSION=` + - `make bundle-build -e IMAGE_TAG_BASE= VERSION= PREVIOUS_VERSION=` + - `make bundle-push -e IMAGE_TAG_BASE= VERSION= PREVIOUS_VERSION=` To create a new openshift-community-operator-release: - - `make openshift-community-operator-release -e IMG_TAG_BASE= VERSION= PREVIOUS_VERSION=` + - `make openshift-community-operator-release -e IMAGE_TAG_BASE= VERSION= PREVIOUS_VERSION=` ## Testing The CodeFlare Operator currently has unit tests and pre-commit checks diff --git a/Makefile b/Makefile index 215bdefb8..d5ce65fdc 100644 --- a/Makefile +++ b/Makefile @@ -170,6 +170,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} $(KUSTOMIZE) build config/default | kubectl apply -f - + git restore config/* .PHONY: undeploy undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. @@ -241,6 +242,7 @@ bundle: defaults manifests kustomize install-operator-sdk ## Generate bundle man cd config/manifests && $(KUSTOMIZE) edit add patch --patch '[{"op":"add", "path":"/spec/replaces", "value": "codeflare-operator.v$(PREVIOUS_VERSION)" }]' --kind ClusterServiceVersion $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) $(MAKE) validate-bundle + git restore config/* .PHONY: bundle-build bundle-build: bundle ## Build the bundle image.