首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FATA[0004]未能初始化项目:无法使用“base.go.kubebuilder.io/v3”作为支架:退出状态2

FATA[0004]未能初始化项目:无法使用“base.go.kubebuilder.io/v3”作为支架:退出状态2
EN

Stack Overflow用户
提问于 2021-05-18 11:16:50
回答 6查看 3.4K关注 0票数 1

我正在尝试使用operator创建一个操作符。

我已经在我的mac上安装了opeator。

我的环境细节:

go版本go1.15.12达尔文/amd64 64

operator版本:"v1.7.2",提交:"6db9787d4e9ff63f344e23bfa387133112bda56b",kubernetes版本:"v1.19.4",go版本:"go1.16.3",GOOS:"amd64"

我试着用命令创建一个操作符-

代码语言:javascript
复制
operator-sdk init hello-operator

我启用了GO111MODULE。

当我试图运行opeator init时,我会得到以下错误。

代码语言:javascript
复制
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

有人知道这件事吗?

提前谢谢。

EN

回答 6

Stack Overflow用户

发布于 2021-05-19 13:23:38

在我的围棋环境设置上花了一段时间之后,我终于弄明白了。我有不同版本的链接。

我把我的/usr/local/opt/go@1.15/libexec改成了->,然后我就能把它写进反光镜。

票数 0
EN

Stack Overflow用户

发布于 2021-08-27 14:48:12

检查您的GOPATH文件夹权限。在我的例子中,kubebuilder拒绝了访问,并显示了与您发现的错误相同的错误。

你也可以尝试重新安装GO Lang在一个不同的文件夹,看看会发生什么。

票数 0
EN

Stack Overflow用户

发布于 2022-02-25 17:18:31

我也有同样的问题。

我运行了go env,发现路径权限不正确。

一旦我修复了它们,我就能继续

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67585119

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档