Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

controller-gen fails when path is not wildcard #884

Closed
AndreiBarbuOz opened this issue Feb 18, 2024 · 2 comments
Closed

controller-gen fails when path is not wildcard #884

AndreiBarbuOz opened this issue Feb 18, 2024 · 2 comments

Comments

@AndreiBarbuOz
Copy link

Running the controller-gen works when using wildcards:

./bin/controller-gen crd paths="./pkg/apis/foo/v1alpha1/..." output:stdout

but fails when running on a specific file:

./bin/controller-gen crd paths="./pkg/apis/foo/v1alpha1/bar_types.go" output:stdout

with output:

Error: load packages in root "/home/baz/go/src/github.com/org/project/pkg/apis/foo/v1alpha1/bar_types.go": err: fork/exec /usr/local/go/bin/go: not a directory: stderr:

output of go version

$ go version
go version go1.21.4 linux/amd64

output of go env

$ go env
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/baz/.cache/go-build'
GOENV='/home/baz/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/baz/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/baz/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/baz/go/src/github.com/org/project/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3594283129=/tmp/go-build -gno-record-gcc-switches'
@AndreiBarbuOz AndreiBarbuOz changed the title controller-gen fails when path is absolute controller-gen fails when path is not wildcard Feb 18, 2024
@sbueringer
Copy link
Member

sbueringer commented Apr 10, 2024

@AndreiBarbuOz would this be covered by #864?

@AndreiBarbuOz
Copy link
Author

yes @sbueringer , looks like it. I'll close this issue as a duplicate of #837

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants