Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include generation of generated files in build process of controller …
…image Since PR openshift#211, generated files are no longer part of this repo. However, the build process of the main artifact, controller container image, hasn't been adapted to the absence of generated files and currently fails. This change adds generation of generated files to the build process. It does so by replacing the bare `go build` command with a `build` Makefile target invocation. The 'build' target takes care of both file generation (as a prerequisite) and building itself. Several small adjustments are necessary to support running the 'build' target during the controller image build process. Apart from Makefile, also hack/ needs to exist in the builder image as it contains input for the file generator. A COPY command had to be adjusted as `make build` leaves the resulting binary in ./bin instead of ./ . Finally, 'go mod vendor' is used to avoid an "inconsistent vendoring" error. Apparently, 'controller-gen' which runs as part of file generation invokes 'go' internally without passing it the '-mod=mod' flag which effectively disables vendoring. 'go mod vendor' is then a way to bring vendoring into agreement with go.mod.
- Loading branch information