我有以下值。yaml
documentStorage:
folders:
TEST1:
permissions:
read: "test1@email.com"
write: "test1@email.com"
TEST2:
permissions:
read: "test2@email.com"
write: "test2@email.com"
而且,我想将其移动到我的配置映射中,但是,由于可以扩展文件夹下的键,因此我想使用范围功能。而且,如果可能的话,我想复制下面的确切结构:
documentStorage:
folders:
{{- range $folder, $structure := .Values.global.documentStorage.folders }}
{{ $folder }}: {{ $structure }}
{{- end}}
但是,它不起作用,我得到了:
folders:
TEST1:
permissions: map[read:test1@email.com write:test1@email.com]
TEST2:
permissions: map[read:test2@email.com write:test2@email.com]
我想念什么?
答案 0 :(得分:2)
使用以下代码段。您需要根据将documentStorage设置在哪个嵌套级别来更改indent的值
documentStorage:
folders:
{{ .Values.documentStorage.folders | toYaml | indent 6 }}