forked from openshift-knative/serverless-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
356 lines (283 loc) · 12.7 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# Useful for local development
dev:
./hack/dev.sh
# General purpose targets
images:
./hack/images.sh $(DOCKER_REPO_OVERRIDE)
install:
./hack/install.sh
install-operator:
INSTALL_SERVING="false" INSTALL_EVENTING="false" ./hack/install.sh
install-all:
UNINSTALL_STRIMZI="false" ./hack/strimzi.sh
./hack/tracing.sh
SCALE_UP=4 INSTALL_KAFKA="true" ENABLE_TRACING=true ./hack/install.sh
install-release-next: generated-files-release-next
ON_CLUSTER_BUILDS=true ./hack/images.sh image-registry.openshift-image-registry.svc:5000/openshift-marketplace
USE_RELEASE_NEXT=true DOCKER_REPO_OVERRIDE=image-registry.openshift-image-registry.svc:5000/openshift-marketplace ./hack/install.sh
install-tracing:
./hack/tracing.sh
install-serving:
INSTALL_EVENTING="false" ./hack/install.sh
install-serving-with-mesh:
UNINSTALL_MESH="false" ./hack/mesh.sh
MESH=true SCALE_UP=4 INSTALL_SERVING=true INSTALL_EVENTING="false" ./hack/install.sh
install-eventing:
INSTALL_SERVING="false" ./hack/install.sh
install-kafka:
SCALE_UP=4 INSTALL_SERVING="false" INSTALL_KAFKA="true" ./hack/install.sh
install-kafka-with-mesh:
UNINSTALL_MESH="false" ./hack/mesh.sh
TRACING_BACKEND=zipkin TRACING_NAMESPACE=knative-eventing ./hack/tracing.sh
UNINSTALL_STRIMZI="false" ./hack/strimzi.sh
MESH=true SCALE_UP=5 INSTALL_SERVING=false INSTALL_EVENTING=true INSTALL_KAFKA=true TRACING_BACKEND=zipkin TRACING_NAMESPACE=knative-eventing ENABLE_TRACING=true ./hack/install.sh
install-kafka-with-keda:
UNINSTALL_KEDA="false" ./hack/keda.sh
SCALE_UP=4 INSTALL_SERVING="false" INSTALL_KAFKA="true" ENABLE_KEDA="true" ./hack/install.sh
install-strimzi:
UNINSTALL_STRIMZI="false" ./hack/strimzi.sh
uninstall-strimzi:
UNINSTALL_STRIMZI="true" ./hack/strimzi.sh
install-keda:
UNINSTALL_KEDA="false" ./hack/keda.sh
uninstall-keda:
UNINSTALL_KEDA="true" ./hack/keda.sh
install-certmanager:
UNINSTALL_CERTMANAGER="false" ./hack/certmanager.sh
uninstall-certmanager:
UNINSTALL_CERTMANAGER="true" ./hack/certmanager.sh
install-previous:
INSTALL_PREVIOUS_VERSION="true" ./hack/install.sh
install-previous-with-kafka:
INSTALL_PREVIOUS_VERSION="true" INSTALL_KAFKA="true" ./hack/install.sh
install-mesh:
UNINSTALL_MESH="false" ./hack/mesh.sh
uninstall-mesh:
UNINSTALL_MESH="true" ./hack/mesh.sh
install-tracing-zipkin:
TRACING_BACKEND=zipkin ./hack/tracing.sh
uninstall-tracing-zipkin:
UNINSTALL_TRACING=true TRACING_BACKEND=zipkin ./hack/tracing.sh
install-tracing-opentelemetry:
./hack/tracing.sh
uninstall-tracing-opentelemetry:
UNINSTALL_TRACING=true ./hack/tracing.sh
install-cluster-logging:
./hack/clusterlogging.sh
teardown:
./hack/teardown.sh
# Test targets for CI operator.
test-unit:
go test ./knative-operator/...
go test ./openshift-knative-operator/...
go test ./serving/ingress/...
go test ./serving/metadata-webhook/...
# Run only SERVING/EVENTING E2E tests from the current repo.
test-e2e-testonly:
./test/e2e-tests.sh
test-e2e:
./hack/tracing.sh
ENABLE_TRACING=true ./hack/install.sh
./test/e2e-tests.sh
DELETE_CRD_ON_TEARDOWN="false" ./hack/teardown.sh
# Run E2E tests from the current repo for serving+eventing+knativeKafka
test-e2e-with-kafka-testonly:
TEST_KNATIVE_KAFKA=true ./test/e2e-tests.sh
operator-e2e:
UNINSTALL_STRIMZI="false" ./hack/strimzi.sh
./hack/tracing.sh
SCALE_UP=4 INSTALL_KAFKA="true" ENABLE_TRACING=true ./hack/install.sh
TEST_KNATIVE_KAFKA=true ./test/e2e-tests.sh
DELETE_CRD_ON_TEARDOWN="false" ./hack/teardown.sh
test-e2e-with-kafka: operator-e2e
# Run E2E tests from the current repo for serving+eventing+mesh
test-e2e-with-mesh-testonly:
MESH=true ./test/e2e-tests.sh
test-e2e-with-mesh:
UNINSTALL_MESH="false" ./hack/mesh.sh
./hack/tracing.sh
UNINSTALL_STRIMZI="false" ./hack/strimzi.sh
MESH=true SCALE_UP=4 INSTALL_KAFKA="true" ENABLE_TRACING=true ./hack/install.sh
MESH=true TEST_KNATIVE_KAFKA=true ./test/e2e-tests.sh
# Run both unit and E2E tests from the current repo.
test-operator: test-unit test-e2e
# Run upstream E2E tests with net-istio and sidecar.
# TODO: Enable upgrade tests once upstream fixed the issue https://github.com/knative/serving/issues/11535.
test-upstream-e2e-mesh-testonly:
MESH=true TEST_KNATIVE_KAFKA=true ./test/e2e-tests.sh
MESH=true TEST_KNATIVE_KAFKA=false TEST_KNATIVE_SERVING=true TEST_KNATIVE_EVENTING=true TEST_KNATIVE_KAFKA_BROKER=true TEST_KNATIVE_UPGRADE=false ./test/upstream-e2e-tests.sh
install-for-mesh-e2e:
UNINSTALL_MESH="false" ./hack/mesh.sh
TRACING_BACKEND=zipkin TRACING_NAMESPACE=knative-eventing ./hack/tracing.sh
UNINSTALL_STRIMZI="false" ./hack/strimzi.sh
MESH=true SCALE_UP=6 INSTALL_SERVING=true INSTALL_EVENTING=true INSTALL_KAFKA=true TRACING_BACKEND=zipkin TRACING_NAMESPACE=knative-eventing ENABLE_TRACING=true ./hack/install.sh
mesh-e2e: install-for-mesh-e2e
MESH=true TEST_KNATIVE_KAFKA=true ./test/e2e-tests.sh
MESH=true TEST_KNATIVE_KAFKA=false TEST_KNATIVE_SERVING=true TEST_KNATIVE_EVENTING=true TEST_KNATIVE_KAFKA_BROKER=true TEST_KNATIVE_UPGRADE=false ./test/upstream-e2e-tests.sh
test-upstream-e2e-mesh: mesh-e2e
# Run upstream E2E tests without upgrades.
test-upstream-e2e-no-upgrade-testonly:
MESH=true ./test/e2e-tests.sh
MESH=true TEST_KNATIVE_SERVING=true TEST_KNATIVE_EVENTING=true TEST_KNATIVE_KAFKA_BROKER=true TEST_KNATIVE_UPGRADE=false ./test/upstream-e2e-tests.sh
test-upstream-e2e-kafka-no-upgrade-testonly:
TEST_KNATIVE_KAFKA_BROKER=true TEST_KNATIVE_E2E=true TEST_KNATIVE_UPGRADE=false ./test/upstream-e2e-tests.sh
upstream-e2e:
TRACING_BACKEND=zipkin ./hack/tracing.sh
TRACING_BACKEND=zipkin ENABLE_TRACING=true ./hack/install.sh
TEST_KNATIVE_KAFKA=false TEST_KNATIVE_E2E=true TEST_KNATIVE_SERVING=true TEST_KNATIVE_EVENTING=true TEST_KNATIVE_UPGRADE=false ./test/upstream-e2e-tests.sh
test-upstream-e2e-no-upgrade: upstream-e2e
upstream-e2e-kafka:
UNINSTALL_STRIMZI="false" ./hack/strimzi.sh
TRACING_BACKEND=zipkin ./hack/tracing.sh
SCALE_UP=6 INSTALL_KAFKA="true" TRACING_BACKEND=zipkin ENABLE_TRACING=true ./hack/install.sh
TEST_KNATIVE_KAFKA_BROKER=true TEST_KNATIVE_E2E=true TEST_KNATIVE_UPGRADE=false ./test/upstream-e2e-tests.sh
test-upstream-e2e-kafka-no-upgrade: upstream-e2e-kafka
# Run only upstream upgrade tests.
test-upstream-upgrade-testonly:
TEST_KNATIVE_KAFKA=true TEST_KNATIVE_E2E=false TEST_KNATIVE_UPGRADE=true ./test/upstream-e2e-tests.sh
test-upgrade:
TRACING_BACKEND=zipkin ZIPKIN_DEDICATED_NODE=true ./hack/tracing.sh
UNINSTALL_STRIMZI=false ./hack/strimzi.sh
INSTALL_PREVIOUS_VERSION=true INSTALL_KAFKA=true TRACING_BACKEND=zipkin ENABLE_TRACING=true SCALE_UP=5 ./hack/install.sh
TEST_KNATIVE_KAFKA=true TEST_KNATIVE_E2E=false TEST_KNATIVE_UPGRADE=true ./test/upstream-e2e-tests.sh
mesh-upgrade:
UNINSTALL_MESH=false ./hack/mesh.sh
TRACING_BACKEND=zipkin ./hack/tracing.sh
UNINSTALL_STRIMZI=false ./hack/strimzi.sh
MESH=true INSTALL_PREVIOUS_VERSION=true INSTALL_KAFKA=true TRACING_BACKEND=zipkin ENABLE_TRACING=true SCALE_UP=5 ./hack/install.sh
MESH=true TEST_KNATIVE_KAFKA=true TEST_KNATIVE_E2E=false TEST_KNATIVE_UPGRADE=true ./test/upstream-e2e-tests.sh
test-upgrade-with-mesh: mesh-upgrade
kitchensink-upgrade:
UNINSTALL_STRIMZI="false" ./hack/strimzi.sh
./hack/dev.sh
INSTALL_OLDEST_COMPATIBLE="true" INSTALL_KAFKA="true" SCALE_UP=4 ./hack/install.sh
./test/kitchensink-upgrade-tests.sh
test-kitchensink-upgrade: kitchensink-upgrade
test-kitchensink-upgrade-testonly:
./test/kitchensink-upgrade-tests.sh
test-kitchensink-upgrade-stress:
UNINSTALL_STRIMZI=false ./hack/strimzi.sh
INSTALL_PREVIOUS_VERSION=true INSTALL_KAFKA=true SCALE_UP=5 ./hack/install.sh
./test/kitchensink-upgrade-stress-tests.sh
test-kitchensink-upgrade-stress-testonly:
./test/kitchensink-upgrade-stress-tests.sh
# Run Console UI e2e tests.
test-ui-e2e-testonly:
./test/ui-e2e-tests.sh
ui-e2e:
./hack/install.sh
./test/ui-e2e-tests.sh
test-ui-e2e: ui-e2e
# Run only kitchensink e2e tests
test-kitchensink-e2e-testonly:
./test/kitchensink-e2e-tests.sh
# Run only a subset of e2e tests, e.g. "make test-kitchensink-e2e-single-testonly TEST=TestBroker"
test-kitchensink-e2e-single-testonly:
./test/kitchensink-e2e-tests.sh -run $(TEST)
test-kitchensink-e2e-setup:
UNINSTALL_STRIMZI="false" ./hack/strimzi.sh
SCALE_UP=4 INSTALL_KAFKA="true" ./hack/install.sh
# Runs all subsets of kitchensink tests. Runs tests separately so `go test` doesn't take too much memory in CI
kitchensink-e2e:
UNINSTALL_STRIMZI="false" ./hack/strimzi.sh
SCALE_UP=4 INSTALL_KAFKA="true" ./hack/install.sh
./test/kitchensink-e2e-tests.sh -run TestBrokerReadinessBrokerDLS
./test/kitchensink-e2e-tests.sh -run TestBrokerReadinessTriggerDLS
./test/kitchensink-e2e-tests.sh -run TestChannelReadiness
./test/kitchensink-e2e-tests.sh -run TestFlowReadiness
./test/kitchensink-e2e-tests.sh -run TestSourceReadiness
test-kitchensink-e2e: kitchensink-e2e
# Soak tests
test-soak-testonly:
./test/soak-tests.sh
test-soak:
UNINSTALL_STRIMZI="false" ./hack/strimzi.sh
SCALE_UP=5 INSTALL_KAFKA="true" ./hack/install.sh
./test/soak-tests.sh
# Run all E2E tests.
test-all-e2e:
./hack/tracing.sh
ENABLE_TRACING=true ./hack/install.sh
./test/e2e-tests.sh
TEST_KNATIVE_KAFKA=true TEST_KNATIVE_E2E=true TEST_KNATIVE_UPGRADE=false ./test/upstream-e2e-tests.sh
TEST_KNATIVE_KAFKA=true TEST_KNATIVE_E2E=false TEST_KNATIVE_UPGRADE=true ./test/upstream-e2e-tests.sh
./test/ui-e2e-tests.sh
DELETE_CRD_ON_TEARDOWN="false" ./hack/teardown.sh
# Generates a ci-operator configuration for a specific branch.
generate-ci-config:
./openshift/ci-operator/generate-ci-config.sh $(BRANCH) > ci-operator-config.yaml
# Generates all files that are templated with release metadata.
release-files:
./hack/generate/csv.sh \
templates/csv.yaml \
olm-catalog/serverless-operator/manifests/serverless-operator.clusterserviceversion.yaml
./hack/generate/annotations.sh \
templates/annotations.yaml \
olm-catalog/serverless-operator/metadata/annotations.yaml
./hack/generate/dockerfile.sh \
templates/knative-operator.Dockerfile \
knative-operator/Dockerfile
./hack/generate/dockerfile.sh \
templates/openshift-knative-operator.Dockerfile \
openshift-knative-operator/Dockerfile
./hack/generate/dockerfile.sh \
templates/serving-ingress.Dockerfile \
serving/ingress/Dockerfile
./hack/generate/dockerfile.sh \
templates/serving-metadata-webhook.Dockerfile \
serving/metadata-webhook/Dockerfile
./hack/generate/dockerfile.sh \
templates/main.Dockerfile \
olm-catalog/serverless-operator/Dockerfile
./hack/generate/dockerfile.sh \
templates/test-source-image.Dockerfile \
openshift/ci-operator/source-image/Dockerfile
./hack/generate/dockerfile.sh \
templates/build-image.Dockerfile \
openshift/ci-operator/build-image/Dockerfile
./hack/generate/dockerfile.sh \
templates/index.Dockerfile \
olm-catalog/serverless-operator/index/Dockerfile
./hack/generate/index.sh \
templates/index.yaml \
olm-catalog/serverless-operator/index/configs/index.yaml
./hack/generate/quickstart.sh \
templates/serverless-application-quickstart.yaml \
knative-operator/deploy/resources/quickstart/serverless-application-quickstart.yaml
./hack/generate/images-rekt.sh \
templates/images-rekt.yaml \
test/images-rekt.yaml
./hack/generate/mesh-auth-policies.sh \
tenant-1,tenant-2,serving-tests,serverless-tests,eventing-e2e0,eventing-e2e1,eventing-e2e2,eventing-e2e3,eventing-e2e4
# Generates all files that can be generated, includes release files, code generation
# and updates vendoring.
# Use CURRENT_VERSION_IMAGES="<branch>" if you need to override the defaulting to main
generated-files: release-files
./hack/update-deps.sh
./hack/update-codegen.sh
(cd knative-operator && ./hack/update-manifests.sh)
(cd openshift-knative-operator && ./hack/update-manifests.sh)
(cd olm-catalog/serverless-operator && ./hack/update-manifests.sh)
./hack/update-deps.sh
generated-files-release-next: release-files
# Re-generate CSV with release-next images
USE_RELEASE_NEXT=true ./hack/generate/csv.sh \
templates/csv.yaml \
olm-catalog/serverless-operator/manifests/serverless-operator.clusterserviceversion.yaml
./hack/update-deps.sh
./hack/update-codegen.sh
(cd knative-operator && USE_RELEASE_NEXT=true ./hack/update-manifests.sh)
(cd openshift-knative-operator && USE_RELEASE_NEXT=true ./hack/update-manifests.sh)
(cd olm-catalog/serverless-operator && USE_RELEASE_NEXT=true ./hack/update-manifests.sh)
./hack/update-deps.sh
# Runs the lints Github Actions do too.
lint:
woke
golangci-lint run
find . -type f -path './**/*.*sh' -not -path '*vendor*' | xargs -r shellcheck
operator-sdk bundle validate ./olm-catalog/serverless-operator --select-optional suite=operatorframework --optional-values=k8s-version=1.22
git ls-files | grep -Ev '^(vendor/|.git)' | xargs misspell -i importas -error
prettier -c templates/*.yaml
# Runs formatters and thelike to fix potential linter warnings.
fix-lint:
prettier --write templates/*.yaml