fix(appset): nodeLabel 改为可选字段(hasKey),避免 missingkey=error 报错
数据源 agents.yaml/edges.yaml 删除 nodeLabel 后,模板 {{- if .nodeLabel }}
在 missingkey=error 下直接报错导致 ApplicationSet 无法生成任何 app。
改用 hasKey . "nodeLabel" 让 nodeLabel 真正可选:有则设 nodeSelector,无则跳过。
This commit is contained in:
1 parent
fb71c439c6
commit
9a1ecc5631
2 files changed
+2
-2
No files matched your search
@@ -35,7 +35,7 @@ spec:
|
||||
site: "{{ .id }}"
|
||||
description: "{{ .description }}"
|
||||
phaseType: "{{ .phaseType }}"
|
||||
{{- if .nodeLabel }}
|
||||
{{- if hasKey . "nodeLabel" }}
|
||||
nodeSelector:
|
||||
mixingx.io/edge-node: "{{ .nodeLabel }}"
|
||||
{{- end }}
|
||||
|
||||
@@ -34,7 +34,7 @@ spec:
|
||||
values: |
|
||||
site: "{{ .id }}"
|
||||
description: "{{ .description }}"
|
||||
{{- if .nodeLabel }}
|
||||
{{- if hasKey . "nodeLabel" }}
|
||||
nodeSelector:
|
||||
mixingx.io/edge-node: "{{ .nodeLabel }}"
|
||||
{{- end }}
|
||||
|
||||
Reference in new issue
Block a user