mirror of
https://github.com/vhaudiquet/homeprod.git
synced 2026-09-12 12:11:14 +00:00
kyverno(kube): foreach patchStrategicMerge must be inline mapping, not block scalar
This commit is contained in:
@@ -88,9 +88,12 @@ spec:
|
|||||||
# `request.object` is available in BOTH admission and background modes:
|
# `request.object` is available in BOTH admission and background modes:
|
||||||
# the backgroundController synthesizes an admission-like request for
|
# the backgroundController synthesizes an admission-like request for
|
||||||
# existing resources, so the same foreach works for both.
|
# existing resources, so the same foreach works for both.
|
||||||
|
# NOTE: inside `foreach`, patchStrategicMerge must be an INLINE YAML
|
||||||
|
# mapping — a `|` block scalar is parsed as a string and fails with
|
||||||
|
# "wrong node kind: expected MappingNode but got ScalarNode".
|
||||||
foreach:
|
foreach:
|
||||||
- list: "request.object.spec.containers"
|
- list: "request.object.spec.containers"
|
||||||
patchStrategicMerge: |
|
patchStrategicMerge:
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: "{{ element.name }}"
|
- name: "{{ element.name }}"
|
||||||
@@ -98,7 +101,7 @@ spec:
|
|||||||
requests:
|
requests:
|
||||||
cpu: null
|
cpu: null
|
||||||
- list: "request.object.spec.initContainers || `[]`"
|
- list: "request.object.spec.initContainers || `[]`"
|
||||||
patchStrategicMerge: |
|
patchStrategicMerge:
|
||||||
spec:
|
spec:
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: "{{ element.name }}"
|
- name: "{{ element.name }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user