Remove config key order check (#1504)

* Make bases and environments equivalent priority config keys

Signed-off-by: Richard Swearingen <drivelikebrazil@gmail.com>
This commit is contained in:
drivelikebrazil 2024-05-07 17:24:08 -05:00 committed by GitHub
parent 73c8b193f6
commit f09855d40e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 6 deletions

View File

@ -17,8 +17,8 @@ var (
separatorRegex = regexp.MustCompile(`^--- *$`)
topkeysPriority = map[string]int{
"bases": 0,
"environments": 1,
"releases": 2,
"environments": 0,
"releases": 1,
}
)

View File

@ -144,24 +144,29 @@ func TestTopConfigKeysVerifier(t *testing.T) {
helmfileContent: []byte("a:\ne:\n"),
wantErr: false,
},
{
name: "no error when correct order 02",
helmfileContent: []byte("environments:\nbases:\nreleases:\n"),
wantErr: false,
},
{
name: "error when not correct order 00",
helmfileContent: []byte("environments:\nbases:\n"),
helmfileContent: []byte("releases:\nbases:\n"),
wantErr: true,
},
{
name: "error when not correct order 01",
helmfileContent: []byte("environments:\nhelmDefaults:\nbases:\n"),
helmfileContent: []byte("releases:\nhelmDefaults:\nbases:\n"),
wantErr: true,
},
{
name: "error when not correct order 02",
helmfileContent: []byte("helmDefaults:\nenvironments:\nbases:\n"),
helmfileContent: []byte("helmDefaults:\nreleases:\nbases:\n"),
wantErr: true,
},
{
name: "error when not correct order 03",
helmfileContent: []byte("environments:\nva:\nve:\nbases:\n"),
helmfileContent: []byte("releases:\nva:\nve:\nbases:\n"),
wantErr: true,
},
{