@@ -143,7 +143,7 @@ ALL_GENERATE_MODULES = core kubeadm-bootstrap kubeadm-control-plane
143
143
144
144
.PHONY : generate
145
145
generate : # # Run all generate-manifests-*, generate-go-deepcopy-* and generate-go-conversions-* targets
146
- $(MAKE ) generate-manifests generate-go-deepcopy generate-go-conversions
146
+ $(MAKE ) generate-modules generate- manifests generate-go-deepcopy generate-go-conversions
147
147
$(MAKE ) -C $(CAPD_DIR ) generate
148
148
149
149
.PHONY : generate-manifests
@@ -280,8 +280,14 @@ generate-go-conversions-kubeadm-control-plane: $(CONVERSION_GEN) ## Generate con
280
280
--output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE ) \
281
281
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
282
282
283
- .PHONY : diagrams
284
- diagrams : # # Generate diagrams for *.plantuml files
283
+ .PHONY : generate-modules
284
+ generate-modules : # # Run go mod tidy to ensure modules are up to date
285
+ go mod tidy
286
+ cd $(TOOLS_DIR ) ; go mod tidy
287
+ cd $(TEST_DIR ) ; go mod tidy
288
+
289
+ .PHONY : generate-diagrams
290
+ generate-diagrams : # # Generate diagrams for *.plantuml files
285
291
$(MAKE ) -C docs diagrams
286
292
287
293
# # --------------------------------------
@@ -290,12 +296,6 @@ diagrams: ## Generate diagrams for *.plantuml files
290
296
291
297
# #@ lint and verify:
292
298
293
- .PHONY : modules
294
- modules : # # Run go mod tidy to ensure modules are up to date
295
- go mod tidy
296
- cd $(TOOLS_DIR ) ; go mod tidy
297
- cd $(TEST_DIR ) ; go mod tidy
298
-
299
299
.PHONY : lint
300
300
lint : $(GOLANGCI_LINT ) # # Lint the codebase
301
301
$(GOLANGCI_LINT ) run -v $(GOLANGCI_LINT_EXTRA_ARGS )
@@ -306,21 +306,21 @@ lint: $(GOLANGCI_LINT) ## Lint the codebase
306
306
lint-fix : $(GOLANGCI_LINT ) # # Lint the codebase and run auto-fixers if supported by the linter
307
307
GOLANGCI_LINT_EXTRA_ARGS=--fix $(MAKE ) lint
308
308
309
+ .PHONY : tiltfile-fix
310
+ tiltfile-fix : # # Format the Tiltfile
311
+ ./hack/verify-starlark.sh fix
312
+
309
313
.PHONY : apidiff
310
314
apidiff : $(GO_APIDIFF ) # # Check for API differences
311
315
$(GO_APIDIFF ) $(shell git rev-parse origin/main) --print-compatible
312
316
313
- .PHONY : format-tiltfile
314
- format-tiltfile : # # Format the Tiltfile
315
- ./hack/verify-starlark.sh fix
316
-
317
317
ALL_VERIFY_CHECKS = doctoc boilerplate shellcheck tiltfile modules gen conversions docker-provider book-links
318
318
319
319
.PHONY : verify
320
320
verify : $(addprefix verify-,$(ALL_VERIFY_CHECKS ) ) # # Run all verify-* targets
321
321
322
322
.PHONY : verify-modules
323
- verify-modules : modules # # Verify go modules are up to date
323
+ verify-modules : generate- modules # # Verify go modules are up to date
324
324
@if ! (git diff --quiet HEAD -- go.sum go.mod $( TOOLS_DIR) /go.mod $( TOOLS_DIR) /go.sum $( TEST_DIR) /go.mod $( TEST_DIR) /go.sum); then \
325
325
git diff; \
326
326
echo " go module files are out of date" ; exit 1; \
@@ -399,10 +399,16 @@ docker-pull-prerequisites:
399
399
docker pull $(GO_CONTAINER_IMAGE )
400
400
docker pull gcr.io/distroless/static:latest
401
401
402
+ .PHONY : docker-build-all
403
+ docker-build-all : $(addprefix docker-build-,$(ALL_ARCH ) ) # # Build docker images for all architectures
404
+
405
+ docker-build-% :
406
+ $(MAKE ) ARCH=$* docker-build
407
+
402
408
ALL_DOCKER_BUILD = core kubeadm-bootstrap kubeadm-control-plane
403
409
404
410
.PHONY : docker-build
405
- docker-build : docker-pull-prerequisites # # Run all docker-build-* targets
411
+ docker-build : docker-pull-prerequisites # # Run docker-build-* targets for all providers
406
412
$(MAKE ) ARCH=$(ARCH ) $(addprefix docker-build-,$(ALL_DOCKER_BUILD ) )
407
413
408
414
.PHONY : docker-build-core
@@ -427,6 +433,10 @@ docker-build-kubeadm-control-plane: ## Build the docker image for kubeadm contro
427
433
e2e-framework : # # Builds the CAPI e2e framework
428
434
cd $(E2E_FRAMEWORK_DIR ) ; go build ./...
429
435
436
+ .PHONY : serve-book
437
+ serve-book : # # Build and serve the book (with live-reload)
438
+ $(MAKE ) -C docs/book serve
439
+
430
440
# # --------------------------------------
431
441
# # Testing
432
442
# # --------------------------------------
@@ -441,32 +451,28 @@ KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use --use-env -p path $(KUBEBUILD
441
451
test : $(SETUP_ENVTEST ) # # Run unit and integration tests
442
452
KUBEBUILDER_ASSETS=" $( KUBEBUILDER_ASSETS) " go test ./... $(TEST_ARGS )
443
453
444
- .PHONY : test-e2e
445
- test-e2e : # # Run the e2e tests
446
- $(MAKE ) -C $( TEST_DIR ) /e2e run
454
+ .PHONY : test-verbose
455
+ test-verbose : # # Run unit and integration tests with verbose flag
456
+ $(MAKE ) test TEST_ARGS= " $( TEST_ARGS ) -v "
447
457
448
458
.PHONY : test-junit
449
- test-junit : $(SETUP_ENVTEST ) $(GOTESTSUM ) # # Run tests with verbose setting and generate a junit report
459
+ test-junit : $(SETUP_ENVTEST ) $(GOTESTSUM ) # # Run unit and integration tests and generate a junit report
450
460
set +o errexit; (KUBEBUILDER_ASSETS=" $( KUBEBUILDER_ASSETS) " go test -json ./... $( TEST_ARGS) ; echo $$ ? > $( ARTIFACTS) /junit.exitcode) | tee $(ARTIFACTS ) /junit.stdout
451
461
$(GOTESTSUM ) --junitfile $(ARTIFACTS ) /junit.xml --raw-command cat $(ARTIFACTS ) /junit.stdout
452
462
exit $$(cat $(ARTIFACTS ) /junit.exitcode )
453
463
454
464
.PHONY : test-cover
455
- test-cover : # # Run tests with code coverage and code generate reports
465
+ test-cover : # # Run unit and integration tests and generate a coverage report
456
466
$(MAKE ) test TEST_ARGS=" $( TEST_ARGS) -coverprofile=out/coverage.out"
457
467
go tool cover -func=out/coverage.out -o out/coverage.txt
458
468
go tool cover -html=out/coverage.out -o out/coverage.html
459
469
460
- .PHONY : test-verbose
461
- test-verbose : # # Run tests with verbose settings
462
- $(MAKE ) test TEST_ARGS=" $( TEST_ARGS) -v"
463
-
464
- .PHONY : serve-book
465
- serve-book : # # Build and serve the book with live-reloading enabled
466
- $(MAKE ) -C docs/book serve
470
+ .PHONY : test-e2e
471
+ test-e2e : # # Run e2e tests
472
+ $(MAKE ) -C $(TEST_DIR ) /e2e run
467
473
468
474
.PHONY : kind-cluster
469
- kind-cluster : # # Create a new kind cluster designed for testing with Tilt
475
+ kind-cluster : # # Create a new kind cluster designed for development with Tilt
470
476
hack/kind-install-for-capd.sh
471
477
472
478
.PHONY : docker-build-e2e
@@ -604,12 +610,6 @@ release-notes: $(RELEASE_NOTES_DIR) $(RELEASE_NOTES)
604
610
go run ./hack/tools/release/notes.go --from=$(PREVIOUS_TAG ) > $(RELEASE_NOTES_DIR ) /$(RELEASE_TAG ) .md; \
605
611
fi
606
612
607
- .PHONY : docker-build-all
608
- docker-build-all : $(addprefix docker-build-,$(ALL_ARCH ) ) # # Build all the architecture docker images
609
-
610
- docker-build-% :
611
- $(MAKE ) ARCH=$* docker-build
612
-
613
613
.PHONY : promote-images
614
614
promote-images : $(KPROMO )
615
615
$(KPROMO ) pr --project cluster-api --tag $(RELEASE_TAG ) --reviewers " $( IMAGE_REVIEWERS) " --fork $(USER_FORK )
0 commit comments