controller-gen currently does not respect/support Go build tags (-tags) passed via the GOFLAGS environment variable. This creates issues when working with code that relies on build constraints.
When trying to build using:
export GOFLAGS="-tags=mymodule"
controller-gen object paths=./apis/...
For example, the tags provided are not passed to the build.
Therefore, failures might occur for projects that rely on C-based packages.
Expected Behavior
controller-gen should respect the GOFLAGS environment variable.
- Build tags should be properly applied when processing Go files.
Also, it seems related to: #871