1

我正在尝试使 argocd cli 输出 yaml/json 为脚本摄取做好准备。

根据此 PR:https ://github.com/argoproj/argo-cd/pull/2551 它应该可用,但我在 cli 帮助和文档中都找不到该选项。

#argocd version:                                                                                                                                    
argocd: v2.1.2+7af9dfb
...
argocd-server: v2.0.3+8d2b13d
4

1 回答 1

2

一些命令接受-o json标志来请求 JSON 输出。

查看命令文档以找到支持该标志的命令。

argocd cluster list -o json,例如,将返回已配置集群的 JSON 列表。文档如下所示:

选项

   -h, --help            help for get
   -o, --output string  
Output format. One of: json|yaml|wide|server (default "yaml")
于 2021-11-10T23:40:24.497 回答