fix(test): update error messages for unknown field in helmfile.yaml

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero 2025-04-07 08:58:06 +08:00 committed by yxxhero
parent a5a44e5242
commit 6e6b479473
1 changed files with 2 additions and 2 deletions

View File

@ -414,7 +414,7 @@ releases:
t.Run("fail due to unknown field with goccy/go-yaml", func(t *testing.T) { t.Run("fail due to unknown field with goccy/go-yaml", func(t *testing.T) {
check(t, testcase{ check(t, testcase{
goccyGoYaml: true, goccyGoYaml: true,
error: `in ./helmfile.yaml: failed to read helmfile.yaml: reading document at index 1: [4:3] unknown field "foobar" error: `in ./helmfile.yaml: failed to read helmfile.yaml: reading document at index 1, you should add .gotmpl extension to your helmfile to enable helmfile to load it as a template since helmfile v1: [4:3] unknown field "foobar"
2 | releases: 2 | releases:
3 | - name: app1 3 | - name: app1
> 4 | foobar: FOOBAR > 4 | foobar: FOOBAR
@ -426,7 +426,7 @@ releases:
t.Run("fail due to unknown field with gopkg.in/yaml.v2", func(t *testing.T) { t.Run("fail due to unknown field with gopkg.in/yaml.v2", func(t *testing.T) {
check(t, testcase{ check(t, testcase{
goccyGoYaml: false, goccyGoYaml: false,
error: `in ./helmfile.yaml: failed to read helmfile.yaml: reading document at index 1: yaml: unmarshal errors: error: `in ./helmfile.yaml: failed to read helmfile.yaml: reading document at index 1, you should add .gotmpl extension to your helmfile to enable helmfile to load it as a template since helmfile v1: yaml: unmarshal errors:
line 4: field foobar not found in type state.ReleaseSpec`, line 4: field foobar not found in type state.ReleaseSpec`,
}) })
}) })