kubebuilder报错Error: failed to initialize project: unable to scaffold with “base.go.kubebuilder.io/v4
$ go get sigs.k8s.io/controller-runtime@v0.16.3go: sigs.k8s.io/controller-runtime@v0.16.3: Get "https://proxy.golang.org/sigs.k8s.io/controller-runtime/@v/v0.16.3.mod": dial tcp 142.251.42.241:443: i/
·
执行kubebuilder init时报错
$ go get sigs.k8s.io/controller-runtime@v0.16.3
go: sigs.k8s.io/controller-runtime@v0.16.3: Get "https://proxy.golang.org/sigs.k8s.io/controller-runtime/@v/v0.16.3.mod": dial tcp 142.251.42.241:443: i/o timeout
Error: failed to initialize project: unable to scaffold with "base.go.kubebuilder.io/v4": exit status 1
可以看到有timeout,原因是没有设置go的代理,访问超时
解决办法:
$ go env -w GO111MODULE=on
$ go env -w GOPROXY=https://goproxy.cn,direct
设置完代理后重新执行kubebuilder init成功。
更多推荐
已为社区贡献1条内容
所有评论(0)