Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't put Go directory at the same level than source
Currently when we build the container image we put the source code in the home directory of the `builder` user. That means that the source code will be in `/home/builder` and the Go module cache will be in `/home/builder/go/pkg`. A side effect of that is that tools like `controller-gen` that scan directories looking for Go code will find our source code, but also the source code of the modules in that module cache. That results in errors because the tool will not find the dependencies of those incorrect source files. To avoid that this patch changes the `Containerfile` so that the source code will be in `/home/builder/project` and the Go module cache in `/home/builder/go/pkg`, that way `controller-gen` will run inside `/home/builder/project` and will not find the Go module cache source files. Note that we are not yet using `controller-gen` in the affected `Containerfile`, but we will use it in the future. Signed-off-by: Juan Hernandez <[email protected]>
- Loading branch information