Skip to content

Commit f01cef2

Browse files
committed
fix(helm): version-agnostic schema-error assertions in the secret-length suite
Helm v4 phrases schema rejections as 'minLength: got N, want 32' while v3 says 'String length must be greater than or equal to 32'. The suite grepped for 'minLength' only, so it passed on local helm v4 and failed on CI's v3.16.4 — the enforcement itself works on both. Patterns now assert the key name plus either wording. Caught by the new Helm Chart workflow on its very first run.
1 parent 187e266 commit f01cef2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

helm/sim/tests/schema-secret-length_test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tests:
1313
postgresql.auth.password: xxxxxxxx
1414
asserts:
1515
- failedTemplate:
16-
errorPattern: "BETTER_AUTH_SECRET.*minLength"
16+
errorPattern: "BETTER_AUTH_SECRET.*(minLength|greater than or equal to 32)"
1717

1818
- it: rejects an ENCRYPTION_KEY shorter than 32 characters
1919
set:
@@ -24,7 +24,7 @@ tests:
2424
postgresql.auth.password: xxxxxxxx
2525
asserts:
2626
- failedTemplate:
27-
errorPattern: "ENCRYPTION_KEY.*minLength"
27+
errorPattern: "ENCRYPTION_KEY.*(minLength|greater than or equal to 32)"
2828

2929
- it: rejects a postgresql.auth.password shorter than 8 characters
3030
set:
@@ -35,7 +35,7 @@ tests:
3535
postgresql.auth.password: short
3636
asserts:
3737
- failedTemplate:
38-
errorPattern: "password.*minLength"
38+
errorPattern: "password.*(minLength|greater than or equal to 8)"
3939

4040
- it: accepts an empty BETTER_AUTH_SECRET (deferred to existingSecret/ESO)
4141
templates:

0 commit comments

Comments
 (0)