我正在尝试使用operator创建一个操作符。
我已经在我的mac上安装了opeator。
我的环境细节:
go版本go1.15.12达尔文/amd64 64
operator版本:"v1.7.2",提交:"6db9787d4e9ff63f344e23bfa387133112bda56b",kubernetes版本:"v1.19.4",go版本:"go1.16.3",GOOS:"amd64"
我试着用命令创建一个操作符-
operator-sdk init hello-operator我启用了GO111MODULE。
当我试图运行opeator init时,我会得到以下错误。
Writing kustomize manifests for you to edit...
Writing scaffold for you to edit...
Get controller runtime:
$ go get sigs.k8s.io/controller-runtime@v0.8.3
# container/list
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# crypto/internal/subtle
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# unicode/utf8
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# internal/race
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# k8s.io/apimachinery/pkg/selection
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# encoding
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# unicode/utf16
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# internal/nettrace
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# math/bits
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# runtime/internal/sys
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# internal/unsafeheader
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# unicode
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# vendor/golang.org/x/crypto/internal/subtle
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# crypto/subtle
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# vendor/golang.org/x/crypto/cryptobyte/asn1
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# golang.org/x/sys/internal/unsafeheader
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# runtime/internal/atomic
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# google.golang.org/protobuf/internal/flags
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# github.com/google/go-cmp/cmp/internal/flags
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# k8s.io/utils/integer
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# k8s.io/utils/buffer
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# internal/cpu
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# k8s.io/apimachinery/pkg/types
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# sync/atomic
compile: version "go1.15.6" does not match go tool version "go1.15.12"
# runtime/cgo
compile: version "go1.15.6" does not match go tool version "go1.15.12"
Error: failed to initialize project: unable to scaffold with "base.go.kubebuilder.io/v3": exit status 2
FATA[0003] failed to initialize project: unable to scaffold with "base.go.kubebuilder.io/v3": exit status 2有人知道这件事吗?
提前谢谢。
发布于 2021-05-19 13:23:38
在我的围棋环境设置上花了一段时间之后,我终于弄明白了。我有不同版本的链接。
我把我的/usr/local/opt/go@1.15/libexec改成了->,然后我就能把它写进反光镜。
发布于 2021-08-27 14:48:12
检查您的GOPATH文件夹权限。在我的例子中,kubebuilder拒绝了访问,并显示了与您发现的错误相同的错误。
你也可以尝试重新安装GO Lang在一个不同的文件夹,看看会发生什么。
发布于 2022-02-25 17:18:31
我也有同样的问题。
我运行了go env,发现路径权限不正确。
一旦我修复了它们,我就能继续
https://stackoverflow.com/questions/67585119
复制相似问题