fix: helm version check failed

Signed-off-by: William Wang <williamw0825@gmail.com>
This commit is contained in:
William Wang 2025-12-01 11:52:40 +08:00
parent 0c39ac1d17
commit dc76123495
2 changed files with 9 additions and 1 deletions

View File

@ -1,7 +1,7 @@
---
- name: Binary | Verify if Helm is already installed
ignore_errors: true
command: helm version --template "{{ .Version }}"
command: helm version --template "{{ "{{" }} .Version {{ "}}" }}"
register: helm_install_version
- name: Binary | Install Helm if not present or version mismatch

View File

@ -294,6 +294,14 @@ func TestParseValue(t *testing.T) {
},
excepted: []byte("bar"),
},
{
name: "{{ & }} character translation",
input: "helm version --template \"{{ \"{{\" }} .Version {{ \"}}\" }}\"",
variable: map[string]any{
"foo": "bar",
},
excepted: []byte("helm version --template \"{{ .Version }}\""),
},
}
for _, tc := range testcases {