如何在shell脚本中以编程方式更新gcloud组件?
呼叫gcloud components update需要用户输入,例如:
$ gcloud components update
The following components will be installed:
--------------------------------------------
| kubectl (Linux, x86_64) | 1.0.1 | 4.5 MB |
--------------------------------------------
For the latest release notes, please visit:
https://dl.google.com/dl/cloudsdk/release/RELEASE_NOTES
Do you want to continue (Y/n)?
Run Code Online (Sandbox Code Playgroud)
我无法找到gcloud强制执行更新的论据.
Zac*_*man 17
你正在寻找 --quiet国旗.
从 gcloud --help:
--quiet, -q
Disable all interactive prompts when running gcloud commands. If input
is required, defaults will be used, or an error will be raised.
Run Code Online (Sandbox Code Playgroud)
这通常是您需要非交互式上下文的标志.
您还可以将CLOUDSDK_CORE_DISABLE_PROMPTS环境变量设置为非空值:
export CLOUDSDK_CORE_DISABLE_PROMPTS=1
gcloud components update # This works for all gcloud commands
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2521 次 |
| 最近记录: |