-
Notifications
You must be signed in to change notification settings - Fork 203
/
Taskfile.yml
1318 lines (1180 loc) · 53.2 KB
/
Taskfile.yml
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
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
version: '3.7'
run: when_changed
output: prefixed
vars:
PACKAGE: github.com/Azure/azure-service-operator/v2
GENERATOR_APP: aso-gen
GENERATOR_ROOT: v2/tools/generator/
ASOCTL_APP: asoctl
ASOCTL_ROOT: v2/cmd/asoctl/
CONTROLLER_APP: aso-controller
CONTROLLER_ROOT: v2/
CONTROLLER_OUTPUT:
sh: 'realpath v2/config'
MANGLE_ROOT: v2/tools/mangle-test-json
TEST_RESOURCE_PREFIX: asotest
TEST_LIVE_RESOURCE_PREFIX: asolivetest
SCRIPTS_ROOT:
sh: 'realpath scripts/v2'
HEADER_FILE:
sh: 'realpath v2/boilerplate.go.txt'
TEST_OUT:
sh: 'realpath reports'
VERSION:
# Version tags for the v2 controller must start with "v2", e.g. "v2.0.0-alpha.0".
sh: "{{.SCRIPTS_ROOT}}/build_version.py v2"
LATEST_VERSION_TAG:
sh: git describe --tags $(git rev-list --tags='v2*' --max-count=1) --match 'v2*'
VERSION_FLAGS: '"-X {{.PACKAGE}}/internal/version.BuildVersion={{.VERSION}}"'
LDFLAGS: -ldflags {{.VERSION_FLAGS}}
CONTROLLER_DOCKER_IMAGE: azureserviceoperator:{{.VERSION}}
PUBLIC_REGISTRY: mcr.microsoft.com/k8s/
LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE: localhost:5000/azureserviceoperator:latest
CROSSPLANE_APP: crossplane-gen
CROSSPLANE_ROOT: ./hack/crossplane/
CROSSPLANE_OUTPUT:
sh: 'realpath hack/crossplane/config'
# how long to let tests against live resources run for
LIVE_TEST_TIMEOUT: 3h
ASO_NAMESPACE: azureserviceoperator-system
ACR_NAME:
sh: "echo $(hostname)asoacr | sed 's/[^[:alpha:]]//g'" # Only alphanumeric allowed for acr names
KIND_WORKLOAD_IDENTITY_PATH: "v2/out/kind-identity"
AKS_WORKLOAD_IDENTITY_PATH: "v2/out/aks-identity"
tasks:
default:
cmds:
- task: format-code # Run before quick-checks to avoid racing with generated file creation
- task: quick-checks
quick-checks:
desc: Perform all fast local pre-commit tasks.
deps:
- generator:quick-checks
- controller:quick-checks
- asoctl:quick-checks
- crossplane:quick-checks
- mangle-test:quick-checks
setup:
desc: Perform setup tasks
cmds:
- "mkdir -p {{.TEST_OUT}}"
ci:
desc: Run all CI checks.
cmds:
# Run tasks in sequence to avoid racing with generated file creation,
# and to avoid running the generator in parallel
- task: generator:ci
- task: controller:ci
- task: crossplane:ci
- task: asoctl:ci
- task: format-code
- task: verify-no-changes
ci-live:
desc: Run all CI checks with live Azure resources. Requires that auth environment variables are set.
deps:
- generator:ci
- controller:ci-live
format-code:
desc: Ensure all code is formatted
dir: v2
cmds:
- golangci-lint run --fix ./... --timeout 5m # I don't know why fix doesn't use the configured timeout
- gofumpt -l -w .
build-docs-site:
cmds:
- task: doc:build-site
basic-checks:
deps:
- header-check
- specifier-check
make-release-artifacts:
desc: Produce files required for an ASOv2 release
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:run-kustomize
- controller:make-multitenant-files
- asoctl:make-release-artifacts
cmds:
- rm -rf out/release
- mkdir -p out/release
- cp ./bin/{azureserviceoperator,multitenant-cluster,multitenant-tenant}_*.yaml out/release
- cp ./bin/asoctl* out/release
############### Asoctl targets ###############
asoctl:quick-checks:
cmds:
- task: asoctl:unit-tests
- task: basic-checks
- task: asoctl:lint
asoctl:ci:
cmds:
- task: asoctl:unit-tests-cover
- task: basic-checks
- task: asoctl:lint
asoctl:unit-tests:
desc: Run {{.ASOCTL_APP}} unit tests.
dir: '{{.ASOCTL_ROOT}}'
deps:
- controller:generate-crds
cmds:
- go test ./... -tags=noexit -run '{{default ".*" .TEST_FILTER}}'
asoctl:unit-tests-cover:
desc: Run {{.ASOCTL_APP}} unit tests and output coverage.
dir: '{{.ASOCTL_ROOT}}'
deps:
- setup
- controller:generate-crds
cmds:
- defer: # want to run even on failure
task: produce-markdown-summary
vars:
INPUT_FILE: '{{.TEST_OUT}}/asoctl-unit-tests.json'
OUTPUT_FILE: '{{.TEST_OUT}}/asoctl-unit-tests.md'
- go test ./... -tags=noexit -race -covermode atomic -coverprofile='{{.TEST_OUT}}/asoctl-coverage.out' -json -coverpkg=./... -run '{{default ".*" .TEST_FILTER}}' > '{{.TEST_OUT}}/asoctl-unit-tests.json'
asoctl:lint:
desc: Run {{.ASOCTL_APP}} fast lint checks.
dir: '{{.ASOCTL_ROOT}}'
cmds:
- golangci-lint run --verbose --fast=false --timeout 5m ./...
asoctl:build:
desc: Generate the {{.ASOCTL_APP}} binary.
dir: '{{.ASOCTL_ROOT}}'
label: asoctl:build-{{.GOOS}}-{{.GOARCH}}
generates:
- "{{.ARCHIVE}}"
cmds:
- mkdir -p ./bin/{{.GOOS}}-{{.GOARCH}}
- GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build {{.LDFLAGS}} -o {{.EXECUTABLE}}
- if [ "{{.ARCHIVETYPE}}" = ".zip" ]; then zip -j -r {{.ARCHIVE}} {{.EXECUTABLE}}; fi
- if [ "{{.ARCHIVETYPE}}" = ".gz" ]; then gzip -v -c {{.EXECUTABLE}} > {{.ARCHIVE}} ; fi
vars:
GOOS: '{{default OS .GOOS}}'
EXT: '{{if eq .GOOS "windows"}}.exe{{else}}{{end}}'
ARCHIVETYPE: '{{if eq .GOOS "windows"}}.zip{{else}}.gz{{end}}'
GOARCH: '{{default ARCH .GOARCH}}'
EXECUTABLE: ./bin/{{.GOOS}}-{{.GOARCH}}/{{.ASOCTL_APP}}{{.EXT}}
ARCHIVE: ../../bin/{{.ASOCTL_APP}}-{{.GOOS}}-{{.GOARCH}}{{.ARCHIVETYPE}}
asoctl:make-release-artifacts:
desc: Produce asoctl files required for an ASOv2 release
dir: "{{.CONTROLLER_ROOT}}"
deps:
# Regenerating the deepcopy files deletes and regenerates them,
# so we have to ensure this runs before we do any asoctl builds
- controller:run-kustomize
cmds:
- task: asoctl:build
vars: {GOOS: "linux", GOARCH: "amd64"}
- task: asoctl:build
vars: {GOOS: "linux", GOARCH: "arm64"}
- task: asoctl:build
vars: {GOOS: "darwin", GOARCH: "amd64"}
- task: asoctl:build
vars: {GOOS: "darwin", GOARCH: "arm64"}
- task: asoctl:build
vars: {GOOS: "windows", GOARCH: "amd64"}
############### Generator targets ###############
generator:quick-checks:
cmds:
- task: generator:unit-tests
- task: basic-checks
- task: generator:lint
generator:ci:
cmds:
- task: generator:unit-tests-cover
- task: basic-checks
- task: generator:lint
generator:unit-tests:
desc: Run {{.GENERATOR_APP}} unit tests.
dir: '{{.GENERATOR_ROOT}}'
cmds:
- go test ./... -tags=noexit -run '{{default ".*" .TEST_FILTER}}'
generator:unit-tests-cover:
desc: Run {{.GENERATOR_APP}} unit tests and output coverage.
dir: '{{.GENERATOR_ROOT}}'
deps:
- setup
cmds:
- defer: # want to run even on failure
task: produce-markdown-summary
vars:
INPUT_FILE: '{{.TEST_OUT}}/generator-unit-tests.json'
OUTPUT_FILE: '{{.TEST_OUT}}/generator-unit-tests.md'
- go test ./... -tags=noexit -race -covermode atomic -coverprofile='{{.TEST_OUT}}/generator-coverage.out' -json -coverpkg=./... -run '{{default ".*" .TEST_FILTER}}' > '{{.TEST_OUT}}/generator-unit-tests.json'
generator:update-golden-tests:
desc: Update {{.GENERATOR_APP}} golden test outputs.
dir: '{{.GENERATOR_ROOT}}'
cmds:
- go test ./... -run ^TestGolden -update
generator:lint:
desc: Run {{.GENERATOR_APP}} fast lint checks.
dir: '{{.GENERATOR_ROOT}}'
cmds:
- golangci-lint run --verbose --fast=false
generator:build:
desc: Generate the {{.GENERATOR_APP}} binary.
dir: '{{.GENERATOR_ROOT}}'
cmds:
- go build {{.LDFLAGS}} -o ../../bin/{{.GENERATOR_APP}} .
# Stub retained until migration of workflows complete
generator:diagrams:
cmds:
- task: doc:render-diagrams
############### Controller targets ###############
controller:quick-checks:
cmds:
- task: controller:test
# checks must be after test as that will generate code
- task: basic-checks
- task: controller:verify-samples
# Lint is forced to the end because it expects the code is formatted
- task: controller:lint
controller:ci:
cmds:
- task: controller:verify-samples
- task: controller:test-cover
- task: controller:test-integration-ci
# checks must be after test as that will generate code
- task: basic-checks
# lint must be at end after code is formatted
- task: controller:lint
controller:ci-integration-tests:
cmds:
- task: cleanup-old-live-azure-resources
- task: controller:test-integration-kind-ci
- task: controller:test-multitenant-integration-kind-ci
- task: cleanup-old-live-azure-resources # Run this on both sides of the test pass to do our best to avoid leaking something
controller:ci-live:
cmds:
- task: controller:test-integration-ci-live
- task: basic-checks
- task: controller:lint
controller:lint:
desc: Run fast lint checks.
deps:
- controller:generate-crds
dir: "{{.CONTROLLER_ROOT}}"
cmds:
# Setting GOGC to increase how much debris is tolerated before running GC
- GOGC=200 golangci-lint run --verbose --fast=false --timeout 20m ./...
controller:verify-samples:
desc: Verify that a sample exists for each supported resource
deps:
- controller:generate-crds
cmds:
- "{{.SCRIPTS_ROOT}}/check_samples.py v2/"
controller:test:
desc: Run {{.CONTROLLER_APP}} unit tests.
dir: "{{.CONTROLLER_ROOT}}"
# controller:run-kustomize-for-envtest isn't strictly required here, but running it here so that
# integration tests can be run manually (via IDE) after running "task"
deps:
- controller:generate-crds
- controller:run-kustomize-for-envtest
- controller:bundle-crds # bundle-crds is here because some tests assert on generated CRD shape
cmds:
- go test -short -tags=noexit -timeout 10m -run '{{default ".*" .TEST_FILTER}}' ./...
controller:test-cover:
desc: Run {{.CONTROLLER_APP}} unit tests and output coverage.
dir: "{{.CONTROLLER_ROOT}}"
deps:
- setup
- controller:generate-crds
- controller:bundle-crds # bundle-crds is here because some tests assert on generated CRD shape
cmds:
- defer: # want to run even on failure
task: produce-markdown-summary
vars:
INPUT_FILE: '{{.TEST_OUT}}/controller-unit-tests.json'
OUTPUT_FILE: '{{.TEST_OUT}}/controller-unit-tests.md'
# -race fails at the moment in gopter - possibly due to our shared generator variable?
- go test -short -tags=noexit -timeout 10m -covermode atomic -coverprofile='{{.TEST_OUT}}/controller-coverage.out' -json -coverpkg="./..." -run '{{default ".*" .TEST_FILTER}}' ./... > '{{.TEST_OUT}}/controller-unit-tests.json'
controller:test-upgrade-setup:
desc: Setup for upgrade test
dir: "{{.CONTROLLER_ROOT}}"
cmds:
- task: controller:kind-create-wi
- task: controller:create-mi-for-workload-identity
- task: controller:install-cert-manager
- task: controller:package-helm-manifest
# We need the below to wait until cert-manager is up, otherwise the subsequent installation of webhooks fails. See https://cert-manager.io/next-docs/installation/verify/
- "cmctl check api --wait=2m"
controller:test-upgrade-pre-setup:
desc: Setup for the test-upgrade-pre step
dir: "{{.CONTROLLER_ROOT}}"
cmds:
- "helm repo add asov2 https://raw.githubusercontent.com/Azure/azure-service-operator/main/v2/charts"
- "helm repo update"
- "helm upgrade --install aso2 asov2/azure-service-operator \
--create-namespace \
--namespace={{.ASO_NAMESPACE}} \
--set azureSubscriptionID=$AZURE_SUBSCRIPTION_ID \
--set azureTenantID=$AZURE_TENANT_ID \
--set azureClientID={{.AZURE_MI_CLIENT_ID}} \
--set useWorkloadIdentityAuth=true \
--set crdPattern=*"
- task: controller:wait-for-operator-ready
vars:
DIR: "{{.DIR | default .KIND_WORKLOAD_IDENTITY_PATH}}"
AZURE_MI_CLIENT_ID:
sh: "cat {{.DIR}}/azure/miclientid.txt"
controller:test-upgrade-pre:
desc: Test upgrading {{.CONTROLLER_APP}} and helm chart for new release
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:test-upgrade-pre-setup
cmds:
- "kubectl create namespace pre-release"
- "go test -timeout 15m -count=1 -v -run Test_Pre_Release_ResourceCanBeCreated_BeforeUpgrade ./test/pre-release"
vars:
DIR: "{{.DIR | default .KIND_WORKLOAD_IDENTITY_PATH}}"
AZURE_MI_CLIENT_ID:
sh: "cat {{.DIR}}/azure/miclientid.txt"
controller:test-upgrade-apply-prerelease-chart:
desc: Apply the {{.CONTROLLER_APP}} prerelease chart for new release
dir: "{{.CONTROLLER_ROOT}}"
cmds:
- task: controller:docker-push-local
- task: controller:package-helm-manifest
- task: controller:install-helm-wi
vars:
AZURE_MI_CLIENT_ID:
sh: "cat {{.DIR}}/azure/miclientid.txt"
vars:
DIR: "{{.DIR | default .KIND_WORKLOAD_IDENTITY_PATH}}"
controller:test-upgrade-post:
desc: Test upgrading {{.CONTROLLER_APP}} and helm chart for new release
dir: "{{.CONTROLLER_ROOT}}"
cmds:
- task: controller:test-upgrade-apply-prerelease-chart
- "go test -timeout 15m -count=1 -v -run Test_Pre_Release_ResourceCanBeCreated_AfterUpgrade ./test/pre-release"
- task: controller:kind-delete
controller:test-upgrade:
desc: Test upgrading {{.CONTROLLER_APP}} and helm chart for new release
dir: "{{.CONTROLLER_ROOT}}"
cmds:
- task: controller:test-upgrade-setup
- task: controller:test-upgrade-pre
- task: controller:test-upgrade-post
controller:build:
desc: Generate the {{.CONTROLLER_APP}} binary.
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:generate-crds
sources:
- "go.mod"
- "go.sum"
- "**/*.go"
cmds:
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build {{.LDFLAGS}} -o ./bin/{{.CONTROLLER_APP}} ./cmd/controller/
controller:docker-build:
desc: Builds the {{.CONTROLLER_APP}} Docker image.
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:bundle-crds
run: always
sources:
- "go.mod"
- "go.sum"
- "**/*.go"
- "out/crds/**/*"
- Dockerfile
cmds:
- docker build . --build-arg VERSION_FLAGS={{.VERSION_FLAGS}} --build-arg CONTROLLER_APP={{.CONTROLLER_APP}} -t {{.CONTROLLER_DOCKER_IMAGE}}
controller:docker-build-and-save:
desc: Builds the {{.CONTROLLER_APP}} Docker image and saves it using docker save.
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:docker-build
cmds:
- docker save {{.CONTROLLER_DOCKER_IMAGE}} > bin/$(echo '{{.CONTROLLER_DOCKER_IMAGE}}' | sed -e 's/:/_/g').tar
controller:docker-push-local:
desc: Pushes the controller container image to a local registry
deps:
- controller:bundle-crds
dir: "{{.CONTROLLER_ROOT}}"
run: always
sources:
- "go.mod"
- "go.sum"
- "**/*.go"
- "out/crds/**/*"
- Dockerfile
cmds:
# We don't use multi-arch images here for local registry as building cross-platform image takes about 10-15 minutes to build.
# Which would increase our CI time and in the local environment, only the same architecture image is going to be pulled always.
- docker buildx create --driver-opt network=host --use
- docker buildx build --push
--build-arg VERSION_FLAGS={{.VERSION_FLAGS}}
--build-arg CONTROLLER_APP={{.CONTROLLER_APP}}
--tag "{{.LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE}}" .
controller:docker-push-multiarch:
desc: Builds, tags and pushes the multi architecture controller container image to repository
deps:
- controller:bundle-crds
- task: docker-login
vars:
DOCKER_REGISTRY: "{{.DOCKER_REGISTRY}}"
dir: "{{.CONTROLLER_ROOT}}"
run: always
cmds:
- 'if [ -z "{{.DOCKER_PUSH_TARGET}}" ]; then echo "Error: DOCKER_PUSH_TARGET must be set"; exit 1; fi'
- docker buildx create --use
- docker buildx build --push
--build-arg VERSION_FLAGS={{.VERSION_FLAGS}}
--build-arg CONTROLLER_APP={{.CONTROLLER_APP}}
--platform {{.PLATFORMS}}
--tag "{{.DOCKER_PUSH_TARGET}}/{{.CONTROLLER_DOCKER_IMAGE}}" .
vars:
PLATFORMS: '{{default "linux/amd64,linux/arm64" .PLATFORMS}}'
DOCKER_PUSH_TARGET:
sh: |
if [ ! -z "${DOCKER_PUSH_TARGET}" ]; then
echo "${DOCKER_PUSH_TARGET}"
else
echo "{{.DOCKER_PUSH_TARGET}}"
fi
controller:acr-protect-image:
desc: Protects an existing image in ACR from being updated or deleted
dir: "{{.CONTROLLER_ROOT}}"
deps:
- az-login
run: always
cmds:
- 'if [ -z "{{.DOCKER_PUSH_TARGET}}" ]; then echo "Error: DOCKER_PUSH_TARGET must be set"; exit 1; fi'
- 'if [ -z "${DOCKER_REGISTRY}" ]; then echo "Error: DOCKER_REGISTRY must be set"; exit 1; fi'
- az acr repository update --name ${DOCKER_REGISTRY} --image "{{.DOCKER_PUSH_TARGET}}/{{.CONTROLLER_DOCKER_IMAGE}}" --write-enabled false --delete-enabled false
vars:
# This strips the leftmost .*.azurecr.io/ from the PUSH_TARGET as the acr repository update command doesn't want that bit in the image parameter
DOCKER_PUSH_TARGET:
sh: |
if [ ! -z "${DOCKER_PUSH_TARGET}" ]; then
echo "${DOCKER_PUSH_TARGET}" | sed -e "s|^.*.azurecr.io/||"
else
echo "{{.DOCKER_PUSH_TARGET}}" | sed -e "s|^.*.azurecr.io/||"
fi
controller:test-integration-envtest:
desc: Run integration tests with envtest using record/replay.
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:run-kustomize-for-envtest
cmds:
# -race fails at the moment in controller-runtime
# We run these in sequence right now because it doesn't gain us much speed to go in parallel
- go test -count=1 -timeout {{.TIMEOUT}} -run '{{default ".*" .TEST_FILTER}}' {{.VERBOSE}} ./internal/controllers
- go test -count=1 -timeout {{.TIMEOUT}} -run '{{default ".*" .TEST_FILTER}}' {{.VERBOSE}} ./pkg/genruntime/test
- go test -count=1 -timeout {{.TIMEOUT}} -run '{{default ".*" .TEST_FILTER}}' {{.VERBOSE}} ./internal/genericarmclient
vars:
VERBOSE:
sh: if [ $TEST_FILTER ]; then echo "-v"; fi
TIMEOUT: '{{default "15m" .TIMEOUT}}'
# This target is intended for local use only
controller:test-integration-envtest-record:
desc: Run integration tests with envtest with a longer timeout suitable for recording the tests.
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:run-kustomize-for-envtest
cmds:
- go test -timeout {{.TIMEOUT}} -run '{{default ".*" .TEST_FILTER}}' {{.VERBOSE}} ./internal/controllers -args -live
vars:
VERBOSE:
sh: if [ $TEST_FILTER ]; then echo "-v"; fi
TIMEOUT: '{{.LIVE_TEST_TIMEOUT}}'
controller:test-integration-envtest-cover:
desc: Run integration tests with envtest using record/replay and output coverage.
dir: "{{.CONTROLLER_ROOT}}"
deps:
- setup
- controller:run-kustomize-for-envtest
cmds:
- defer: # want to run even on failure
task: produce-markdown-summary
vars:
INPUT_FILE: '{{.TEST_OUT}}/controller-integration-tests.json'
OUTPUT_FILE: '{{.TEST_OUT}}/controller-integration-tests.md'
- defer: # want to run even on failure
task: produce-markdown-summary
vars:
INPUT_FILE: '{{.TEST_OUT}}/controller-integration-genruntime-tests.json'
OUTPUT_FILE: '{{.TEST_OUT}}/controller-integration-genruntime-tests.md'
- defer: # want to run even on failure
task: produce-markdown-summary
vars:
INPUT_FILE: '{{.TEST_OUT}}/controller-integration-genericarmclient-tests.json'
OUTPUT_FILE: '{{.TEST_OUT}}/controller-integration-genericarmclient-tests.md'
# -race fails at the moment in controller-runtime
- go test -covermode atomic -coverprofile='{{.TEST_OUT}}/coverage-integration-envtest.out' -coverpkg="./..." -json -timeout 15m -run '{{default ".*" .TEST_FILTER}}' ./internal/controllers > '{{.TEST_OUT}}/controller-integration-tests.json'
- go test -covermode atomic -coverprofile='{{.TEST_OUT}}/coverage-integration-genruntime-envtest.out' -coverpkg="./..." -json -timeout 15m -run '{{default ".*" .TEST_FILTER}}' ./pkg/genruntime/test > '{{.TEST_OUT}}/controller-integration-genruntime-tests.json'
- go test -covermode atomic -coverprofile='{{.TEST_OUT}}/coverage-integration-genericarmclient-envtest.out' -coverpkg="./..." -json -timeout 15m -run '{{default ".*" .TEST_FILTER}}' ./internal/genericarmclient > '{{.TEST_OUT}}/controller-integration-genericarmclient-tests.json'
controller:test-integration-envtest-live:
desc: Run integration tests with envtest against live data and output coverage.
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:run-kustomize-for-envtest
- cleanup-azure-resources
cmds:
# -race fails at the moment in controller-runtime
- go test -timeout {{.LIVE_TEST_TIMEOUT}} -covermode atomic -coverprofile='{{.TEST_OUT}}/coverage-integration-envtest-live.out' -coverpkg="./..." -run '{{default ".*" .TEST_FILTER}}' ./internal/controllers -args -live
env:
RECORD_REPLAY: 0
controller:test-integration-kind-ci:
desc: Run live integration tests in kind and deletes the kind cluster afterwards.
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:kind-create-helm-workload-identity
cmds:
# This timeout is purposefully low - if we find that this job is taking a long time we may need to think of other ways
# to keep CI fast
- defer: { task: controller:kind-delete }
- go test -timeout 40m -run '{{default ".*" .TEST_FILTER}}' ./test
# Note that this target isn't used in CI and is intended for use when running locally on a kind cluster
# that you don't want to delete (in contrast to test-integration-kind-ci which will delete the kind cluster
# when it is done.
controller:test-integration-kind:
desc: Run live integration tests in kind.
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:kind-create-helm-workload-identity
cmds:
# This timeout is purposefully low - if we find that this job is taking a long time we may need to think of other ways
# to keep CI fast
- go test -timeout 40m -v -run '{{default ".*" .TEST_FILTER}}' ./test
controller:test-multitenant-integration-kind-ci:
desc: Run live multitenant integration tests in kind.
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:kind-create-multitenant-cluster-helm
cmds:
# This timeout is purposefully low - if we find that this job is
# taking a long time we may need to think of other ways to keep
# CI fast
- defer: { task: controller:kind-delete }
- go test -timeout 15m -v -run '{{default ".*" .TEST_FILTER}}' ./test/multitenant
# Note that this target isn't used in CI and is intended for use
# when running locally on a kind cluster that you don't want to
# delete (in contrast to test-multitenant-integration-kind which
# will delete the kind cluster when it is done.
controller:test-multitenant-integration-kind:
desc: Run live multitenant integration tests in kind.
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:kind-create-multitenant-cluster-helm
cmds:
# This timeout is purposefully low - if we find that this job is
# taking a long time we may need to think of other ways to keep
# CI fast
- go test -timeout 15m -v -run '{{default ".*" .TEST_FILTER}}' ./test/multitenant
controller:test-integration-ci:
desc: Run integration tests for CI
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:test-integration-envtest-cover
controller:test-integration-ci-live:
desc: Run integration tests for CI in live mode
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:test-integration-envtest-live
controller:generate-types:
desc: Run {{.GENERATOR_APP}} to generate input files for controller-gen for {{.CONTROLLER_APP}}.
dir: v2
deps:
- generator:build
sources:
- ./bin/{{.GENERATOR_APP}}
- azure-arm.yaml
- ../docs/hugo/content/reference
cmds:
- ./bin/{{.GENERATOR_APP}} gen-types azure-arm.yaml
controller:generate-crds:
desc: Run controller-gen to generate {{.CONTROLLER_APP}} CRD files.
deps:
- controller:generate-types
- controller:generate-genruntime-deepcopy
sources:
- "v2/api/**/*.go" # depends on all API types
- "v2/pkg/genruntime/**/*.go" # Also depends on the genruntime types as they're embedded into the CRDs
cmds:
- mkdir -p v2/api
- find v2/api -type f -name "zz_generated.*" -delete
- if [ -d "{{.CONTROLLER_OUTPUT}}/crd/generated/bases" ]; then find "{{.CONTROLLER_OUTPUT}}/crd/generated/bases" -type f -delete; fi
- if [ -d "{{.CONTROLLER_OUTPUT}}/crd/generated/patches" ]; then find "{{.CONTROLLER_OUTPUT}}/crd/generated/patches" -type f -delete; fi
- cd v2/api && controller-gen {{.OBJECT_OPTIONS}} paths=./...
- cd v2/api && controller-gen {{.CRD_OPTIONS}} {{.WEBHOOK_OPTIONS}} {{.RBAC_OPTIONS}} paths=./...
- cd v2/api && gofumpt -l -w . # format all generated code
vars:
OBJECT_OPTIONS: object:headerFile={{.HEADER_FILE}}
CRD_OPTIONS: crd:crdVersions=v1,allowDangerousTypes=true output:crd:artifacts:config={{.CONTROLLER_OUTPUT}}/crd/generated/bases
WEBHOOK_OPTIONS: webhook output:webhook:artifacts:config={{.CONTROLLER_OUTPUT}}/webhook
RBAC_OPTIONS: rbac:roleName=manager-role output:rbac:artifacts:config={{.CONTROLLER_OUTPUT}}/rbac
controller:generate-genruntime-deepcopy:
desc: Run controller-gen to generate {{.CONTROLLER_APP}} CRD files.
dir: "{{.CONTROLLER_ROOT}}"
sources:
- "pkg/genruntime/**/*.go"
cmds:
- find ./pkg/genruntime -type f -name "zz_generated.*" -delete
- cd pkg/genruntime && controller-gen {{.OBJECT_OPTIONS}} paths=./...
- cd pkg/genruntime && gofmt -l -s -w . # We do this because controller-gen can generate these files in a way that isn't gofmt'ed which can break things down the line
vars:
OBJECT_OPTIONS: object:headerFile={{.HEADER_FILE}}
controller:generate-kustomize:
desc: Run {{.GENERATOR_APP}} to generate the Kustomize file for registering CRDs.
deps:
- controller:generate-crds
dir: v2
sources:
- bin/{{.GENERATOR_APP}}
- config/crd/generated/bases/**/*.yaml
generates:
- config/crd/generated/kustomization.yaml
- config/crd/generated/patches/**/*.yaml
cmds:
- bin/{{.GENERATOR_APP}} gen-kustomize config/crd/generated
controller:run-kustomize:
desc: Generates the CRD & configuration bundle.
deps:
- controller:generate-kustomize
dir: "v2/"
cmds:
- mkdir -p bin # in case it doesn't exist
- "{{.SCRIPTS_ROOT}}/kustomize-build.sh -k operator -v {{.VERSION}} | sed -e 's@{{.LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE}}@{{.PUBLIC_REGISTRY}}{{.CONTROLLER_DOCKER_IMAGE}}@g' > bin/azureserviceoperator_{{.VERSION}}.yaml"
- "{{.SCRIPTS_ROOT}}/kustomize-build.sh -k crd -v {{.VERSION}} > bin/azureserviceoperator_customresourcedefinitions_{{.VERSION}}.yaml"
vars:
VERSION: "{{default .VERSION .VERSION_TAG}}"
CONTROLLER_DOCKER_IMAGE: "{{default .CONTROLLER_DOCKER_IMAGE .CONTROLLER_IMAGE}}"
controller:make-multitenant-files:
desc: Splits the deployment yaml into cluster and tenant files for multitenant deployment
deps:
- controller:run-kustomize
dir: "v2/bin"
cmds:
- '{{.SCRIPTS_ROOT}}/make-multitenant-cluster.sh "{{.VERSION}}" "azureserviceoperator_{{.VERSION}}.yaml"'
- '{{.SCRIPTS_ROOT}}/make-multitenant-tenant.sh "{{.VERSION}}" "azureserviceoperator_{{.VERSION}}.yaml"'
controller:run-kustomize-for-envtest:
desc: Generates the CRDs for use in envtest
deps:
- controller:generate-kustomize
dir: "v2/"
sources:
- config/crd/**/*.yaml
generates:
- out/envtest/crds/azureserviceoperator.yaml
cmds:
- mkdir -p out/envtest/crds
- find "out/envtest/crds" -type f -delete
- kustomize build config/crd/generated > out/envtest/crds/azureserviceoperator.yaml
scripts:build-python-venv:
desc: Creates a Python virtual env
dir: "{{.SCRIPTS_ROOT}}"
cmds:
- python3 -m virtualenv venv
- venv/bin/pip3 install -r requirements.txt
controller:validate-helm:
desc: Validates and compares helm against the ASO yaml generated by kustomize and ensures that they match
dir: "{{.CONTROLLER_ROOT}}"
deps:
- task: controller:run-kustomize
vars:
VERSION_TAG: "{{.LATEST_VERSION_TAG}}"
CONTROLLER_IMAGE: "azureserviceoperator:{{.LATEST_VERSION_TAG}}"
- task: scripts:build-python-venv
defer:
cmds:
- "{{.SCRIPTS_ROOT}}/venv/bin/python3 {{.SCRIPTS_ROOT}}/validate_helm.py --helm-dir=$PWD/charts/azure-service-operator --yaml-path=$PWD/bin/azureserviceoperator_{{.LATEST_VERSION_TAG}}.yaml"
controller:package-helm-manifest:
desc: Package helm manifest for the release
dir: "{{.CONTROLLER_ROOT}}"
deps:
- controller:generate-kustomize
cmds:
- "{{.SCRIPTS_ROOT}}/package-helm-manifest.sh -i {{.LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE}} -r {{.PUBLIC_REGISTRY}} -v {{.LATEST_VERSION_TAG}} -d `pwd`/"
- task: controller:validate-helm
controller:install-helm-wi:
desc: Generate and install helm chart on cluster using workload identity
dir: "{{.CONTROLLER_ROOT}}"
cmds:
- "helm upgrade --install --set azureSubscriptionID=$AZURE_SUBSCRIPTION_ID \
--set azureTenantID=$AZURE_TENANT_ID \
--set azureClientID={{.AZURE_MI_CLIENT_ID}} \
--set useWorkloadIdentityAuth=true \
{{.IMAGE_REPOSITORY_CMD}} \
--set crdPattern=* \
aso2 -n {{.ASO_NAMESPACE}} --create-namespace ./charts/azure-service-operator/"
- task: controller:wait-for-operator-ready
vars:
IMAGE_REPOSITORY: "{{default .LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE .IMAGE_REPOSITORY}}"
OVERRIDE_IMAGE_REPOSITORY: "{{default true .OVERRIDE_IMAGE_REPOSITORY}}"
IMAGE_REPOSITORY_CMD_DEFAULT: "--set image.repository={{.IMAGE_REPOSITORY}}"
IMAGE_REPOSITORY_CMD:
sh: |
if [ "{{.OVERRIDE_IMAGE_REPOSITORY}}" = true ]; then
echo "--set image.repository={{.IMAGE_REPOSITORY}}"
else
echo ""
fi
controller:install-helm-single-tenant:
desc: Generate and install helm chart on cluster using workload identity
dir: "{{.CONTROLLER_ROOT}}"
cmds:
- "helm upgrade --install --set azureSubscriptionID=$AZURE_SUBSCRIPTION_ID \
--set azureTenantID=$AZURE_TENANT_ID \
--set azureClientID={{.AZURE_MI_CLIENT_ID}} \
--set image.repository={{.LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE}} \
--set useWorkloadIdentityAuth=true \
--set multitenant.enable=true \
--set azureOperatorMode=watchers \
--set-string azureTargetNamespaces='{t1-items,t1-more}' \
aso2 -n tenant1-system --create-namespace ./charts/azure-service-operator/"
vars:
IMAGE_REPOSITORY: "{{default .LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE .IMAGE_REPOSITORY}}"
AZURE_MI_CLIENT_ID:
sh: "cat {{.KIND_WORKLOAD_IDENTITY_PATH}}/azure/miclientid.txt #controller:install-helm-single-tenant" # Comment required to disambiguate sh usage, see: https://github.com/go-task/task/issues/524
controller:delete-helm:
desc: Delete helm release
cmds:
- "helm delete aso2 -n {{.ASO_NAMESPACE}}"
controller:kind-delete:
desc: Deletes a kind cluster
run: always
cmds:
- "kind delete cluster --name=asov2"
- "{{.SCRIPTS_ROOT}}/delete-kind-wi-storage.sh -d {{.KIND_WORKLOAD_IDENTITY_PATH}}"
- "kind delete cluster --name=asov2-wi"
# This is somewhat useless now because we're not using service principal to install ASO anymore
# but keeping it around in case there's some other use for a bare kind cluster.
controller:kind-create:
desc: Creates a kind cluster and local Docker registry. Images in the local registry can be pulled in the kind cluster
run: always
cmds:
- "export KIND_CLUSTER_NAME=asov2 && {{.SCRIPTS_ROOT}}/kind-with-registry.sh"
status:
- "kind get clusters | grep \"^asov2$\""
controller:kind-create-wi:
desc: Creates a kind cluster and local Docker registry with OIDC + workload identity enabled. Images in the local registry can be pulled in the kind cluster.
run: always
deps:
- az-login
cmds:
- "rm -rf {{.KIND_WORKLOAD_IDENTITY_PATH}}"
- "mkdir -p {{.KIND_WORKLOAD_IDENTITY_PATH}}"
- "{{.SCRIPTS_ROOT}}/create-kind-wi-storage.sh -d {{.KIND_WORKLOAD_IDENTITY_PATH}} -p {{.TEST_LIVE_RESOURCE_PREFIX}}"
- "export KIND_CLUSTER_NAME=asov2-wi && \
export SERVICE_ACCOUNT_ISSUER=$(cat {{.KIND_WORKLOAD_IDENTITY_PATH}}/azure/saissuer.txt) && \
{{.SCRIPTS_ROOT}}/kind-with-registry.sh"
status:
- "kind get clusters | grep \"^asov2-wi$\""
env:
SERVICE_ACCOUNT_KEY_FILE:
sh: "echo ${HOSTROOT:-$PWD}/{{.KIND_WORKLOAD_IDENTITY_PATH}}/sa.pub" # Have to use HOSTROOT here for mounting files when in docker-in-docker as paths are relative to host
SERVICE_ACCOUNT_SIGNING_KEY_FILE:
sh: "echo ${HOSTROOT:-$PWD}/{{.KIND_WORKLOAD_IDENTITY_PATH}}/sa.key"
controller:create-mi-for-workload-identity:
desc: Creates a managed identity and federated identity credential and stores their details in the specified path
deps:
- az-login
cmds:
- "{{.SCRIPTS_ROOT}}/make-mi-fic.py -g {{.RESOURCE_GROUP}} -i {{.ISSUER}} -s {{.SUBJECT}} -d ./{{.DIR}}"
vars:
DIR: "{{default .KIND_WORKLOAD_IDENTITY_PATH .DIR}}"
RESOURCE_GROUP_FILE:
sh: "cat ./{{.DIR}}/azure/rg.txt || echo ''"
RESOURCE_GROUP: "{{default .RESOURCE_GROUP_FILE .RESOURCE_GROUP}}"
ISSUER_FILE:
sh: "cat ./{{.DIR}}/azure/saissuer.txt"
ISSUER: "{{default .ISSUER_FILE .ISSUER}}"
SUBJECT: '{{default "system:serviceaccount:azureserviceoperator-system:azureserviceoperator-default" .SUBJECT}}'
controller:aks-create:
desc: Creates an AKS cluster
run: always
deps:
- az-login
cmds:
- "{{.SCRIPTS_ROOT}}/make-aks.sh -l {{.LOCATION}} -g {{.RESOURCE_GROUP_NAME}} -a {{.ACR_NAME}} -c {{.CLUSTER_NAME}} -d {{.AKS_WORKLOAD_IDENTITY_PATH}}"
status:
- az aks show --resource-group {{.RESOURCE_GROUP_NAME}} --name {{.CLUSTER_NAME}} > /dev/null 2>&1
vars:
RESOURCE_GROUP_NAME: "{{.HOSTNAME}}-aso-rg"
CLUSTER_NAME: "{{.HOSTNAME}}-aso-aks"
LOCATION: "westus3"
controller:aks-delete:
desc: Deletes an AKS cluster
run: always
deps:
- az-login
cmds:
- "az group delete --name {{.RESOURCE_GROUP_NAME}} -y"
- "{{.SCRIPTS_ROOT}}/delete-role-assignment.sh -d {{.AKS_WORKLOAD_IDENTITY_PATH}}"
- "rm -rf {{.AKS_WORKLOAD_IDENTITY_PATH}}"
vars:
RESOURCE_GROUP_NAME: "{{.HOSTNAME}}-aso-rg"
controller:aks-create-helm-install:
desc: Deploys ASO onto an AKS cluster
run: always
deps:
- az-login
cmds:
- task: controller:aks-create
- task: controller:create-mi-for-workload-identity
vars:
DIR: "{{.AKS_WORKLOAD_IDENTITY_PATH}}"
RESOURCE_GROUP: "{{.HOSTNAME}}-aso-rg"
- task: controller:install-cert-manager
- task: controller:docker-push-multiarch
vars:
PLATFORMS: "{{OS}}/{{ARCH}}" # Just push to one platform for now
DOCKER_PUSH_TARGET: "{{.ACR_NAME}}.azurecr.io"
DOCKER_REGISTRY: "{{.ACR_NAME}}"
- task: controller:package-helm-manifest
# We need the below to wait until cert-manager is up, otherwise the subsequent installation of webhooks fails. See https://cert-manager.io/next-docs/installation/verify/
- "cmctl check api --wait=2m"
- task: controller:install-helm-wi
vars:
IMAGE_REPOSITORY: "{{.ACR_NAME}}.azurecr.io/{{.CONTROLLER_DOCKER_IMAGE}}"
AZURE_MI_CLIENT_ID:
sh: "cat {{.AKS_WORKLOAD_IDENTITY_PATH}}/azure/miclientid.txt"
controller:scan-image:
desc: Builds a local image and scans the image using trivy
deps:
- controller:docker-build
cmds:
- "trivy image {{.CONTROLLER_DOCKER_IMAGE}}"
- "trivy image --exit-code 1 --ignore-unfixed --severity MEDIUM,HIGH,CRITICAL {{.CONTROLLER_DOCKER_IMAGE}} || exit 1"
controller:install:
desc: Installs the controller, webhooks, and CRDs into the default kubectl cluster
deps:
- controller:generate-kustomize
dir: "{{.CONTROLLER_ROOT}}"
cmds:
- "{{.SCRIPTS_ROOT}}/kustomize-build.sh -k operator -v {{.VERSION}} > out/operator.yaml"
- "sed -i 's/--crd-pattern=.*/--crd-pattern=*/g' out/operator.yaml"
- "kubectl apply --server-side=true -f out/operator.yaml" # TODO: may need | sed "s_${CONFIG_REGISTRY}_${REGISTRY}/${IMG}_" at some point
controller:bundle-crds:
desc: Bundles CRDs...
deps:
- controller:generate-kustomize
dir: "{{.CONTROLLER_ROOT}}"
sources:
- config/**/*.yaml
generates:
- out/crds/**/*.yaml
cmds:
- "rm -rf out/crds"
- "mkdir -p out/crds"
- "{{.SCRIPTS_ROOT}}/kustomize-build.sh -k crd -v {{.VERSION}} -o out/crds"
controller:install-cert-manager:
desc: Installs cert manager
run: always
cmds:
- "kubectl create namespace cert-manager"
- "kubectl label namespace cert-manager cert-manager.io/disable-validation=true"
- "kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.14.4/cert-manager.yaml"
status:
- "kubectl get namespace cert-manager"
controller:make-sp-secret:
desc: Creates a service principal aso-controller-settings secret for testing purposes
cmds:
- "{{.SCRIPTS_ROOT}}/deploy-testing-secret.sh sp"
controller:make-workload-identity-secret:
desc: Creates a workload identity secret for testing purposes
cmds:
- "{{.SCRIPTS_ROOT}}/deploy-testing-secret.sh workloadidentity"
vars:
DIR: "{{.DIR | default .KIND_WORKLOAD_IDENTITY_PATH}}"
env:
# Override the AZURE_CLIENT_ID env variable here
AZURE_MI_CLIENT_ID: # TODO: Ideally would override AZURE_CLIENT_ID here but we can't because of https://github.com/go-task/task/issues/1038
sh: "cat {{.DIR}}/azure/miclientid.txt"
controller:deploy-multitenant-testing-secret:
desc: Deploy a multitenant testing secret
cmds:
- "{{.SCRIPTS_ROOT}}/deploy-multitenant-testing-secret.sh"
env:
# Override the AZURE_CLIENT_ID env variable here
AZURE_MI_CLIENT_ID: # TODO: Ideally would override AZURE_CLIENT_ID here but we can't because of https://github.com/go-task/task/issues/1038
sh: "cat {{.KIND_WORKLOAD_IDENTITY_PATH}}/azure/miclientid.txt"
controller:wait-for-operator-ready:
desc: Waits for the operator and associated CRDs to be ready
run: always
cmds:
- "{{.SCRIPTS_ROOT}}/wait-for-operator-ready.sh -n '{{default .ASO_NAMESPACE .NAMESPACE}}' {{.ARGS}}"