Skip to content

controller-gen Does Not Respect GOFLAGS (-tags) During Build #1158

@camilamacedo86

Description

@camilamacedo86

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions