diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e74b783d..85d98b387 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 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 - `make install` - `make deploy -e IMG=` +For building and pushing a new version of the bundled operator image: + - `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 IMAGE_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` diff --git a/Makefile b/Makefile index ffbcf3905..d5ce65fdc 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 @@ -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. 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