[英]gcloud 'no such file or directory'
On Ubuntu 20.04, gcloud installed with snap install google-cloud-sdk --classic
...在 Ubuntu 20.04 上,gcloud 安装了
snap install google-cloud-sdk --classic
...
Today it no longer works.今天它不再起作用了。 Yesterday there was an auto update.
昨天有一个自动更新。
$ kubectl get all
Unable to connect to the server: error executing access token command "/snap/google-cloud-sdk/188/bin/gcloud config config-helper --format=json": err=fork/exec /snap/google-cloud-sdk/188/bin/gcloud: no such file or directory output= stderr=
Version 188 it is referencing is gone, and it is now at 190. (Version 189 is also present.)它引用的版本 188 不见了,现在是 190。(版本 189 也存在。)
I've uninstalled and deleted the.config/gcloud, and reinstalled, but still have the same error.我已经卸载并删除了.config/gcloud,并重新安装,但仍然有同样的错误。
Any tips on where to look for that stale path?关于在哪里寻找陈旧路径的任何提示?
I suspect it is to be found in your kubectl
config file (on Linux: ${HOME}/.kube/config
or possibly as the value of ${KUBECONFIG}
.我怀疑它可以在您的
kubectl
配置文件中找到(在 Linux 上: ${HOME}/.kube/config
或可能作为${KUBECONFIG}
的值。
For GKE clusters, the relevant user
, auth-provider
, config
will include something similar to cmd-path: /.../google-cloud-sdk/bin/gcloud
and I think that's what you'll want to edit.对于 GKE 集群,相关的
user
、 auth-provider
、 config
将包含类似于cmd-path: /.../google-cloud-sdk/bin/gcloud
,我认为这就是您想要编辑的内容。
The problem is that gcloud stores the absolete reference to the gcloud binary to ~/.kube/config.问题是 gcloud 将对 gcloud 二进制文件的绝对引用存储到 ~/.kube/config。 The solution is to replace
/snap/google-cloud-sdk/.*/gcloud
-> /snap/bin/gcloud
in ~/.kube/config
.解决方案是替换
~/.kube/config
/snap/google-cloud-sdk/.*/gcloud
-> /snap/bin/gcloud
。
Example of accomplishing this with perl
on the command line:在命令行上使用
perl
完成此操作的示例:
perl -i -p -e 's/\/snap\/google-cloud-sdk\/.*?\/gcloud/\/snap\/bin\/gcloud/' ~/.kube/config
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.