Skip to content

Commit 1a80a6c

Browse files
committed
Create OLM upgrade e2e scenario using codeflare SDK
2 parents a1432a2 + c3383c8 commit 1a80a6c

File tree

138 files changed

+1076
-7244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+1076
-7244
lines changed

.github/workflows/e2e_tests.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@ jobs:
9797
echo "Printing CodeFlare operator logs"
9898
kubectl logs -n openshift-operators --tail -1 -l app.kubernetes.io/name=codeflare-operator | tee ${CODEFLARE_TEST_OUTPUT_DIR}/codeflare-operator.log
9999
100-
- name: Print MCAD controller logs
101-
if: always() && steps.deploy.outcome == 'success'
102-
run: |
103-
echo "Printing MCAD controller logs"
104-
kubectl logs -n codeflare-system --tail -1 -l component=multi-cluster-application-dispatcher | tee ${CODEFLARE_TEST_OUTPUT_DIR}/mcad.log
105-
106100
- name: Print KubeRay operator logs
107101
if: always() && steps.deploy.outcome == 'success'
108102
run: |

.github/workflows/olm_tests.yaml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
CSV_VERSION=$(kubectl get ClusterServiceVersion -l operators.coreos.com/codeflare-operator.openshift-operators='' -n openshift-operators -o json | jq -r .items[].spec.version)
116116
echo "PREVIOUS_VERSION=v$CSV_VERSION" >> $GITHUB_ENV
117117
118-
- name: Deploy CodeFlare stack (MCAD, KubeRay)
118+
- name: Deploy CodeFlare stack
119119
run: |
120120
make setup-e2e
121121
@@ -138,10 +138,7 @@ jobs:
138138
export CODEFLARE_TEST_OUTPUT_DIR=${{ env.TEMP_DIR }}
139139
echo "CODEFLARE_TEST_OUTPUT_DIR=${CODEFLARE_TEST_OUTPUT_DIR}" >> $GITHUB_ENV
140140
set -euo pipefail
141-
go test -timeout 30m -v ./test/e2e -run TestMNISTRayClusterUp -json 2>&1 | tee ${CODEFLARE_TEST_OUTPUT_DIR}/gotest.log | gotestfmt
142-
env:
143-
RUN_OLM_TESTS: true
144-
141+
go test -timeout 30m -v ./test/upgrade -run TestMNISTRayClusterUp -json 2>&1 | tee ${CODEFLARE_TEST_OUTPUT_DIR}/gotest.log | gotestfmt
145142
- name: Update Operator to the built version
146143
run: |
147144
ORIGINAL_POD_NAME=$(kubectl get pod -l app.kubernetes.io/name=codeflare-operator -n openshift-operators -o json | jq -r .items[].metadata.name)
@@ -176,10 +173,7 @@ jobs:
176173
export CODEFLARE_TEST_OUTPUT_DIR=${{ env.TEMP_DIR }}
177174
echo "CODEFLARE_TEST_OUTPUT_DIR=${CODEFLARE_TEST_OUTPUT_DIR}" >> $GITHUB_ENV
178175
set -euo pipefail
179-
go test -timeout 30m -v ./test/e2e -run TestMnistJobSubmit -json 2>&1 | tee ${CODEFLARE_TEST_OUTPUT_DIR}/gotest.log | gotestfmt
180-
env:
181-
RUN_OLM_TESTS: true
182-
176+
go test -timeout 30m -v ./test/upgrade -run TestMnistJobSubmit -json 2>&1 | tee ${CODEFLARE_TEST_OUTPUT_DIR}/gotest.log | gotestfmt
183177
- name: Run e2e tests against built operator
184178
run: |
185179
export CODEFLARE_TEST_OUTPUT_DIR=${{ env.TEMP_DIR }}
@@ -194,12 +188,6 @@ jobs:
194188
echo "Printing CodeFlare operator logs"
195189
kubectl logs -n openshift-operators --tail -1 -l app.kubernetes.io/name=codeflare-operator | tee ${CODEFLARE_TEST_OUTPUT_DIR}/codeflare-operator.log
196190
197-
- name: Print MCAD controller logs
198-
if: always() && steps.deploy.outcome == 'success'
199-
run: |
200-
echo "Printing MCAD controller logs"
201-
kubectl logs -n codeflare-system --tail -1 -l component=multi-cluster-application-dispatcher | tee ${CODEFLARE_TEST_OUTPUT_DIR}/mcad.log
202-
203191
- name: Print KubeRay operator logs
204192
if: always() && steps.deploy.outcome == 'success'
205193
run: |

.github/workflows/tag-and-build.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ jobs:
8585

8686
- name: Adjust Compatibility Matrix in readme
8787
run: |
88-
sed -i -E "s/(.*CodeFlare Operator.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.version }}\2${{ github.event.inputs.version }}\3/" README.md
89-
sed -i -E "s/(.*Multi-Cluster App Dispatcher.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.mcad-version }}\2${{ github.event.inputs.mcad-version }}\3/" README.md
90-
sed -i -E "s/(.*CodeFlare-SDK.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.codeflare-sdk-version }}\2${{ github.event.inputs.codeflare-sdk-version }}\3/" README.md
91-
sed -i -E "s/(.*InstaScale.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.instascale-version }}\2${{ github.event.inputs.instascale-version }}\3/" README.md
88+
sed -i -E "s|(.*CodeFlare Operator.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.version }}\2${{ github.event.inputs.version }}\3|" README.md
89+
sed -i -E "s|(.*Multi-Cluster App Dispatcher.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.mcad-version }}\2${{ github.event.inputs.mcad-version }}\3|" README.md
90+
sed -i -E "s|(.*CodeFlare-SDK.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.codeflare-sdk-version }}\2${{ github.event.inputs.codeflare-sdk-version }}\3|" README.md
91+
sed -i -E "s|(.*InstaScale.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.instascale-version }}\2${{ github.event.inputs.instascale-version }}\3|" README.md
9292
9393
- name: Adjust MCAD, SDK and InstaScale dependencies in the code
9494
run: |
@@ -98,8 +98,6 @@ jobs:
9898
sed -i -E "s/(.*MCAD_REF \?= ).*/\1release-\${MCAD_VERSION}/" Makefile
9999
sed -i -E "s/(.*CODEFLARE_SDK_VERSION \?= ).*/\1$CODEFLARE_SDK_VERSION/" Makefile
100100
sed -i -E "s/(.*INSTASCALE_VERSION \?= ).*/\1${{ github.event.inputs.instascale-version }}/" Makefile
101-
sed -i -E "s/(.*instascale-controller:).*/\1${{ github.event.inputs.instascale-version }}/" controllers/testdata/instascale_test_results/case_1/deployment.yaml
102-
sed -i -E "s/(.*instascale-controller:).*/\1${{ github.event.inputs.instascale-version }}/" controllers/testdata/instascale_test_results/case_2/deployment.yaml
103101
104102
- name: Login to Quay.io
105103
uses: redhat-actions/podman-login@v1

.github/workflows/verify_generated_files.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,6 @@ on:
1515
- '**go.mod'
1616
- '**go.sum'
1717
jobs:
18-
verify-generated-functions:
19-
runs-on: ubuntu-latest
20-
steps:
21-
- uses: actions/checkout@v3
22-
- name: Set Go
23-
uses: actions/setup-go@v3
24-
with:
25-
go-version: v1.19
26-
- name: Verify that the DeepCopy, DeepCopyInto, and DeepCopyObject method implementations have been generated
27-
run: make generate && git diff --exit-code
28-
29-
verify-generate-client:
30-
runs-on: ubuntu-latest
31-
steps:
32-
- uses: actions/checkout@v3
33-
- name: Set Go
34-
uses: actions/setup-go@v3
35-
with:
36-
go-version: v1.19
37-
- name: Verify that the latest client has been generated
38-
run: make generate-client && git diff --exit-code
39-
4018
verify-imports:
4119
runs-on: ubuntu-latest
4220
steps:

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
run:
2-
timeout: 5m
2+
timeout: 10m
33
linters:
44
enable:
55
- errcheck

Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ COPY go.mod go.mod
77
COPY go.sum go.sum
88
RUN go mod download
99

10-
# Copy the go source
10+
# Copy the Go sources
1111
COPY main.go main.go
12-
COPY api/ api/
13-
COPY controllers/ controllers/
12+
COPY pkg/ pkg/
1413

1514
# Build
1615
USER root
@@ -19,7 +18,6 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
1918
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7
2019
WORKDIR /
2120
COPY --from=builder /workspace/manager .
22-
COPY config/internal config/internal
2321

2422
USER 65532:65532
2523
ENTRYPOINT ["/manager"]

Makefile

Lines changed: 20 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ VERSION ?= v0.0.0-dev
1212
BUNDLE_VERSION ?= $(VERSION:v%=%)
1313

1414
# INSTASCALE_VERSION defines the default version of the InstaScale controller
15-
INSTASCALE_VERSION ?= v0.0.8
15+
INSTASCALE_VERSION ?= v0.0.9
16+
INSTASCALE_REPO ?= github.com/project-codeflare/instascale
1617

1718
# MCAD_VERSION defines the default version of the MCAD controller
18-
MCAD_VERSION ?= v1.34.1
19-
# MCAD_REF, MCAD_REPO and MCAD_CRD define the reference to MCAD CRD resources
20-
MCAD_REF ?= release-${MCAD_VERSION}
19+
MCAD_VERSION ?= v1.35.0
2120
MCAD_REPO ?= github.com/project-codeflare/multi-cluster-app-dispatcher
2221
# Upstream MCAD is currently only creating release tags of the form `vX.Y.Z` (i.e the version)
23-
# The image is still published using the MCAD_REF format (i.e release-vX.Y.Z)
2422
MCAD_CRD ?= ${MCAD_REPO}/config/crd?ref=${MCAD_VERSION}
2523

2624
# KUBERAY_VERSION defines the default version of the KubeRay operator (used for testing)
@@ -30,7 +28,7 @@ KUBERAY_VERSION ?= v0.6.0
3028
RAY_VERSION ?= 2.5.0
3129

3230
# CODEFLARE_SDK_VERSION defines the default version of the CodeFlare SDK
33-
CODEFLARE_SDK_VERSION ?= 0.7.1
31+
CODEFLARE_SDK_VERSION ?= 0.8.0
3432

3533
# OPERATORS_REPO_ORG points to GitHub repository organization where bundle PR is opened against
3634
# OPERATORS_REPO_FORK_ORG points to GitHub repository fork organization where bundle build is pushed to
@@ -66,12 +64,6 @@ IMAGE_ORG_BASE ?= quay.io/project-codeflare
6664
# codeflare.dev/codeflare-operator-bundle:$VERSION and codeflare.dev/codeflare-operator-catalog:$VERSION.
6765
IMAGE_TAG_BASE ?= $(IMAGE_ORG_BASE)/codeflare-operator
6866

69-
# MCAD_IMAGE defines the default container image for the MCAD controller
70-
MCAD_IMAGE ?= $(IMAGE_ORG_BASE)/mcad-controller:$(MCAD_REF)
71-
72-
# INSTASCALE_IMAGE defines the default container image for the InstaScale controller
73-
INSTASCALE_IMAGE ?= $(IMAGE_ORG_BASE)/instascale-controller:$(INSTASCALE_VERSION)
74-
7567
# RAY_IMAGE defines the default container image for Ray (used for testing)
7668
RAY_IMAGE ?= rayproject/ray:$(RAY_VERSION)
7769

@@ -129,25 +121,10 @@ help: ## Display this help.
129121

130122
##@ Development
131123

132-
DEFAULTS_FILE := controllers/defaults.go
133124
DEFAULTS_TEST_FILE := test/support/defaults.go
134125

135126
.PHONY: defaults
136127
defaults:
137-
$(info Regenerating $(DEFAULTS_FILE))
138-
@echo "package controllers" > $(DEFAULTS_FILE)
139-
@echo "" >> $(DEFAULTS_FILE)
140-
@echo "// ***********************" >> $(DEFAULTS_FILE)
141-
@echo "// DO NOT EDIT THIS FILE" >> $(DEFAULTS_FILE)
142-
@echo "// ***********************" >> $(DEFAULTS_FILE)
143-
@echo "" >> $(DEFAULTS_FILE)
144-
@echo "const (" >> $(DEFAULTS_FILE)
145-
@echo " MCADImage = \"$(MCAD_IMAGE)\"" >> $(DEFAULTS_FILE)
146-
@echo " InstaScaleImage = \"$(INSTASCALE_IMAGE)\"" >> $(DEFAULTS_FILE)
147-
@echo "" >> $(DEFAULTS_FILE)
148-
@echo ")" >> $(DEFAULTS_FILE)
149-
@echo "" >> $(DEFAULTS_FILE)
150-
151128
$(info Regenerating $(DEFAULTS_TEST_FILE))
152129
@echo "package support" > $(DEFAULTS_TEST_FILE)
153130
@echo "" >> $(DEFAULTS_TEST_FILE)
@@ -163,51 +140,11 @@ defaults:
163140
@echo ")" >> $(DEFAULTS_TEST_FILE)
164141
@echo "" >> $(DEFAULTS_TEST_FILE)
165142

166-
gofmt -w $(DEFAULTS_FILE) $(DEFAULTS_TEST_FILE)
143+
gofmt -w $(DEFAULTS_TEST_FILE)
167144

168145
.PHONY: manifests
169-
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
170-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
171-
172-
.PHONY: generate
173-
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
174-
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
175-
176-
.PHONY: generate-client ## Generate client packages and organize the goimports
177-
generate-client: generate-client-files imports
178-
179-
.PHONY: generate-client-files
180-
generate-client-files: code-generator
181-
rm -rf client
182-
$(APPLYCONFIGURATION_GEN) \
183-
--input-dirs="github.com/project-codeflare/codeflare-operator/api/codeflare/v1alpha1" \
184-
--go-header-file="hack/boilerplate.go.txt" \
185-
--output-package="github.com/project-codeflare/codeflare-operator/client/applyconfiguration" \
186-
--output-base="." \
187-
--trim-path-prefix "github.com/project-codeflare/codeflare-operator"
188-
$(CLIENT_GEN) \
189-
--input="codeflare/v1alpha1" \
190-
--input-base="github.com/project-codeflare/codeflare-operator/api" \
191-
--apply-configuration-package="github.com/project-codeflare/codeflare-operator/client/applyconfiguration" \
192-
--go-header-file="hack/boilerplate.go.txt" \
193-
--clientset-name "versioned" \
194-
--output-package="github.com/project-codeflare/codeflare-operator/client/clientset" \
195-
--output-base="." \
196-
--trim-path-prefix "github.com/project-codeflare/codeflare-operator"
197-
$(LISTER_GEN) \
198-
--input-dirs="github.com/project-codeflare/codeflare-operator/api/codeflare/v1alpha1" \
199-
--go-header-file="hack/boilerplate.go.txt" \
200-
--output-base="." \
201-
--output-package="github.com/project-codeflare/codeflare-operator/client/listers" \
202-
--trim-path-prefix "github.com/project-codeflare/codeflare-operator"
203-
$(INFORMER_GEN) \
204-
--input-dirs="github.com/project-codeflare/codeflare-operator/api/codeflare/v1alpha1" \
205-
--versioned-clientset-package="github.com/project-codeflare/codeflare-operator/client/clientset/versioned" \
206-
--listers-package="github.com/project-codeflare/codeflare-operator/client/listers" \
207-
--go-header-file="hack/boilerplate.go.txt" \
208-
--output-base="." \
209-
--output-package="github.com/project-codeflare/codeflare-operator/client/informer" \
210-
--trim-path-prefix "github.com/project-codeflare/codeflare-operator"
146+
manifests: controller-gen ## Generate RBAC objects.
147+
$(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./..."
211148

212149
.PHONY: fmt
213150
fmt: ## Run go fmt against code.
@@ -223,14 +160,16 @@ vet: ## Run go vet against code.
223160
.PHONY: modules
224161
modules: ## Update Go dependencies.
225162
go get $(MCAD_REPO)@$(MCAD_VERSION)
163+
go get $(INSTASCALE_REPO)@$(INSTASCALE_VERSION)
226164
go get github.com/ray-project/kuberay/ray-operator
165+
go mod tidy
227166

228167
.PHONY: build
229-
build: modules defaults generate fmt vet ## Build manager binary.
168+
build: modules defaults fmt vet ## Build manager binary.
230169
go build -o bin/manager main.go
231170

232171
.PHONY: run
233-
run: modules defaults manifests generate fmt vet ## Run a controller from your host.
172+
run: modules defaults manifests fmt vet ## Run a controller from your host.
234173
go run ./main.go
235174

236175
.PHONY: image-build
@@ -249,26 +188,26 @@ endif
249188

250189
.PHONY: install
251190
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
252-
sed -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
191+
$(SED) -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
253192
$(KUSTOMIZE) build config/crd | kubectl apply -f -
254193
git restore config/*
255194

256195
.PHONY: uninstall
257196
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
258-
sed -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
197+
$(SED) -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
259198
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
260199
git restore config/*
261200

262201
.PHONY: deploy
263202
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
264-
sed -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
203+
$(SED) -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
265204
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
266205
$(KUSTOMIZE) build config/default | kubectl apply -f -
267206
git restore config/*
268207

269208
.PHONY: undeploy
270209
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.
271-
sed -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
210+
$(SED) -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
272211
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
273212
git restore config/*
274213

@@ -281,15 +220,12 @@ $(LOCALBIN):
281220

282221
## Tool Binaries
283222
KUSTOMIZE ?= $(LOCALBIN)/kustomize
284-
APPLYCONFIGURATION_GEN ?= $(LOCALBIN)/applyconfiguration-gen
285-
CLIENT_GEN ?= $(LOCALBIN)/client-gen
286-
LISTER_GEN ?= $(LOCALBIN)/lister-gen
287-
INFORMER_GEN ?= $(LOCALBIN)/informer-gen
288223
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
289224
ENVTEST ?= $(LOCALBIN)/setup-envtest
290225
OPENSHIFT-GOIMPORTS ?= $(LOCALBIN)/openshift-goimports
291226
OPERATOR_SDK ?= $(LOCALBIN)/operator-sdk
292227
GH_CLI ?= $(LOCALBIN)/gh
228+
SED ?= /usr/bin/sed
293229

294230
## Tool Versions
295231
KUSTOMIZE_VERSION ?= v4.5.4
@@ -315,29 +251,6 @@ $(GH_CLI): $(LOCALBIN)
315251
rm -rf $(GH_CLI_DL_FILENAME)
316252
rm $(GH_CLI_DL_FILENAME).tar.gz
317253

318-
.PHONY: code-generator
319-
code-generator: $(APPLYCONFIGURATION_GEN) $(CLIENT_GEN) $(LISTER_GEN) $(INFORMER_GEN)
320-
321-
.PHONY: applyconfiguration-gen
322-
applyconfiguration-gen: $(APPLYCONFIGURATION_GEN)
323-
$(APPLYCONFIGURATION_GEN): $(LOCALBIN)
324-
test -s $(LOCALBIN)/applyconfiguration-gen || GOBIN=$(LOCALBIN) go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION)
325-
326-
.PHONY: client-gen
327-
client-gen: $(CLIENT_GEN)
328-
$(CLIENT_GEN): $(LOCALBIN)
329-
test -s $(LOCALBIN)/client-gen || GOBIN=$(LOCALBIN) go install k8s.io/code-generator/cmd/client-gen@$(CODEGEN_VERSION)
330-
331-
.PHONY: lister-gen
332-
lister-gen: $(LISTER_GEN)
333-
$(LISTER_GEN): $(LOCALBIN)
334-
test -s $(LOCALBIN)/lister-gen || GOBIN=$(LOCALBIN) go install k8s.io/code-generator/cmd/lister-gen@$(CODEGEN_VERSION)
335-
336-
.PHONY: informer-gen
337-
informer-gen: $(INFORMER_GEN)
338-
$(INFORMER_GEN): $(LOCALBIN)
339-
test -s $(LOCALBIN)/informer-gen || GOBIN=$(LOCALBIN) go install k8s.io/code-generator/cmd/informer-gen@$(CODEGEN_VERSION)
340-
341254
.PHONY: controller-gen
342255
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
343256
$(CONTROLLER_GEN): $(LOCALBIN)
@@ -367,7 +280,7 @@ validate-bundle: install-operator-sdk
367280
.PHONY: bundle
368281
bundle: defaults manifests kustomize install-operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
369282
$(OPERATOR_SDK) generate kustomize manifests -q
370-
sed -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
283+
$(SED) -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
371284
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
372285
cd config/manifests && $(KUSTOMIZE) edit add patch --patch '[{"op":"add", "path":"/metadata/annotations/containerImage", "value": "$(IMG)" }]' --kind ClusterServiceVersion
373286
cd config/manifests && $(KUSTOMIZE) edit add patch --patch '[{"op":"add", "path":"/spec/replaces", "value": "codeflare-operator.$(PREVIOUS_VERSION)" }]' --kind ClusterServiceVersion
@@ -434,7 +347,7 @@ catalog-build-from-index: opm ## Build a catalog image.
434347
mkdir catalog
435348
$(OPM) render $(CATALOG_BASE_IMG) -o yaml > catalog/bundles.yaml
436349
$(OPM) render $(BUNDLE_IMG) $(OPM_BUNDLE_OPT) > catalog/codeflare-operator-bundle.yaml
437-
sed -i -E "s/(.*)(- name: codeflare-operator.$(PREVIOUS_VERSION).*)/\1- name: codeflare-operator.$(VERSION)\n replaces: codeflare-operator.$(PREVIOUS_VERSION)\n\2/" catalog/bundles.yaml
350+
$(SED) -i -E "s/(.*)(- name: codeflare-operator.$(PREVIOUS_VERSION).*)/\1- name: codeflare-operator.$(VERSION)\n replaces: codeflare-operator.$(PREVIOUS_VERSION)\n\2/" catalog/bundles.yaml
438351
$(OPM) validate catalog
439352
$(OPM) generate dockerfile catalog
440353
podman build . -f catalog.Dockerfile -t $(CATALOG_IMG)
@@ -445,11 +358,11 @@ catalog-push: ## Push a catalog image.
445358
podman push $(CATALOG_IMG) $(CATALOG_PUSH_OPT)
446359

447360
.PHONY: test-unit
448-
test-unit: defaults manifests generate fmt vet envtest ## Run unit tests.
361+
test-unit: defaults manifests fmt vet envtest ## Run unit tests.
449362
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(go list ./... | grep -v /test/) -coverprofile cover.out
450363

451364
.PHONY: test-e2e
452-
test-e2e: defaults manifests generate fmt vet ## Run e2e tests.
365+
test-e2e: defaults manifests fmt vet ## Run e2e tests.
453366
go test -timeout 30m -v ./test/e2e
454367

455368
.PHONY: kind-e2e

0 commit comments

Comments
 (0)