Bosh CLI 预期在路径“/applications/routes”处找到地图,但找到了“[]interface {}”

Bosh CLI Expected to find a map at path '/applications/routes' but found '[]interface {}'

当我 运行 命令时出现此错误:

$ bosh int config.yml --path /applications/routes/route

Expected to find a map at path '/applications/routes' but found '[]interface {}'

Exit code 1

这是我的 config.yml 文件:

applications:
- buildpack: php_buildpack
  instances: 1
  memory: 1G
  name: yxyxy
  routes:
    route: preprod-paas.itn.group
  services:
  - maria-db
  - smtp-mail

任何帮助,我正在使用 bosh CLI V2?

您的 YAML 结构包含具有单个项目的数组。 你需要用这个数组找到一个元素。 我通常按​​名字搜索。在您的情况下,它看起来像:bosh int --path /applications/name=yxyxy/routes/route.

我觉得也可以通过索引获取item /applications/0/routes/route

有语法文档,你可以查看https://github.com/cppforlife/go-patch/blob/master/docs/examples.md