controller-gen fails when path is not wildcard
AndreiBarbuOz opened this issue · 2 comments
AndreiBarbuOz commented
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'
sbueringer commented
@AndreiBarbuOz would this be covered by #864?
AndreiBarbuOz commented
yes @sbueringer , looks like it. I'll close this issue as a duplicate of #837