You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clean up the top-level Makefile in anticipation for integrating more
targets with prow.
Prow e2e tests will be driven by a script in hack
instead of a make target because prow will need special setup compared
to user envs that are more flexible. Currently the script is a
non-functional placeholder to ensure prow integration can be done
without worrying about the script having unexpected bugs. A future PR
will follow up to fill in the e2e script, which can be debugged at that
time.
Similarly, a placeholder script was created for checking that
code/file generation scripts were run by contributors that can be
debugged after prow integration.
There was a minor bug running `make codegen` that was fixed.
Documentation was removed from tool targets to ensure `make help` output
is kept small to help new contributors.
Signed-off-by: Blaine Gardner <[email protected]>
fmt: fmt.client fmt.controller fmt.sidecar ## Format code
64
+
fmt.%: FORCE
65
+
cd$*&& go fmt ./...
66
66
67
67
.PHONY: vet
68
68
vet: vet.client vet.controller vet.sidecar ## Vet code
69
+
vet.%: FORCE
70
+
cd$*&& go vet ./...
69
71
70
72
.PHONY: test
71
-
test: .test.proto test.client test.controller test.sidecar ## Run tests including unit tests
73
+
test: .test.proto test.client test.controller test.sidecar ## Run all unit tests including vet and fmt
74
+
test.%: fmt.% vet.% FORCE
75
+
cd$*&& go test ./...
76
+
.PHONY: .test.proto
77
+
.test.proto: # gRPC proto has a special unit test
78
+
$(MAKE) -C proto check
72
79
73
80
.PHONY: test-e2e
74
81
test-e2e: chainsaw # Run e2e tests against the K8s cluster specified in ~/.kube/config. It requires both controller and driver deployed. If you need to create a cluster beforehand, consider using 'cluster' and 'deploy' targets.
75
82
$(CHAINSAW)test --values ./test/e2e/values.yaml
76
83
77
84
.PHONY: lint
78
85
lint: golangci-lint.client golangci-lint.controller golangci-lint.sidecar ## Run all linters (suggest `make -k`)
86
+
golangci-lint.%: golangci-lint
87
+
cd$*&&$(GOLANGCI_LINT) run --config $(CURDIR)/.golangci.yaml --new
79
88
80
89
.PHONY: lint-fix
81
90
lint-fix: golangci-lint-fix.client golangci-lint-fix.controller golangci-lint-fix.sidecar ## Run all linters and perform fixes where possible (suggest `make -k`)
91
+
golangci-lint-fix.%: golangci-lint
92
+
cd$*&&$(GOLANGCI_LINT) run --config $(CURDIR)/.golangci.yaml --new --fix
82
93
83
94
##@ Build
84
95
96
+
.PHONY: all .gen
97
+
.gen: generate codegen # can be done in parallel with 'make -j'
98
+
.NOTPARALLEL: all # codegen must be finished before fmt/vet
99
+
all: .gen fmt vet build ## Build all container images, plus their prerequisites (faster with 'make -j')
100
+
85
101
.PHONY: build
86
-
build: build.controller build.sidecar ## Build all container images for development
102
+
build: build.controller build.sidecar ## Build container images without prerequisites
87
103
88
104
.PHONY: build.controller build.sidecar
89
105
build.controller: controller/Dockerfile ## Build only the controller container image
@@ -92,49 +108,15 @@ build.sidecar: sidecar/Dockerfile ## Build only the sidecar container image
deploy: kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. The 'generate' and 'codegen' targets should be run manually, and are expected to be run at least once before the 'deploy' target, as those are not cached.
131
+
deploy: kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config
150
132
$(KUSTOMIZE) build .|$(KUBECTL) apply -f -
151
133
152
134
.PHONY: undeploy
153
-
undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
135
+
undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config
0 commit comments