This repository was archived by the owner on Dec 6, 2024. It is now read-only.
standardize make tooling with top level Makefile #93
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Standardize make tooling. Remove unnecessary duplication where possible, including with common copies of go fmt/vet/test targets.
Slighty shift around controller and sidecar 'cmd/' directories to allow specifying a template Dockerfile that can be used to generate Dockerfiles for each image easily.
Where it makes sense, this work adopts the make target naming and Dockerfile usage of the kubebuilder project. The biggest divergence from that template is because we build 2 images from one repo, and because we have a 'proto/' dir for gRPC code.
Significant testing was done to ensure that the tooling works with Unix make on MacOS as well as GNU-Make (gmake). Testing was also done to ensure the
make all
target works well withmake -j
's parallel execution flag, allowing dev speedup where possible.Some proto targets were adjusted to allow make to do a better job detecting when file/code generation is not necessary, saving time in the common case where there are no proto changes.
A future goal, which this helps lay groundwork for, will be to make sure that there are top-level make targets that are usable by Prow CI. For example, 'test' can be used to run all unit tests. Any unit tests added to any component can be included in 'make test' to ensure we don't need to make frequent changes to Prow CI definitions. Similarly 'make build' should build all binaries and images to ensure builds work. 'make generate' and 'make codegen' should include targets that generate files in any way, which will allow Prow CI to ensure developers are running all generators. In the future, we have room to add intall and/or e2e tests as make targets.