【发布时间】:2023-03-16 23:07:01
【问题描述】:
我正在尝试以这种格式配置 YAML 文件:
jobs:
- name: A
- schedule: "0 0/5 * 1/1 * ? *"
- type: mongodb.cluster
- config:
- host: mongodb://localhost:27017/admin?replicaSet=rs
- minSecondaries: 2
- minOplogHours: 100
- maxSecondaryDelay: 120
- name: B
- schedule: "0 0/5 * 1/1 * ? *"
- type: mongodb.cluster
- config:
- host: mongodb://localhost:27017/admin?replicaSet=rs
- minSecondaries: 2
- minOplogHours: 100
- maxSecondaryDelay: 120
我的想法是我可以读取作业元素内的内容,并拥有一系列可以解析的不同作业配置。
但是,yamllint.com 告诉我这是非法的 YAML,因为 mapping values are not allowed in this context at line 2 其中line 2 是jobs: 行。
我做错了什么?
【问题讨论】:
标签: yaml