-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore(helm): add validation for prefix and suffix and capture regression #5250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
309fb18
dbfa7aa
0740f89
1318800
cd0931b
80dd80a
7a43267
ccddc3d
3bc72cd
66ae423
bfa7765
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| {{/* | ||
| Mutually exclusive txtPrefix and txtSuffix | ||
| */}} | ||
| {{- if and .Values.txtPrefix .Values.txtSuffix -}} | ||
| {{- fail (printf "'txtPrefix' and 'txtSuffix' mutually exclusive") -}} | ||
|
||
| {{- end -}} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| suite: Test team namespace constraints | ||
| templates: | ||
| - validation.tpl | ||
| tests: | ||
| - it: should fail when txtPrefix and txtSuffix are set | ||
| templates: | ||
| - validation.tpl | ||
| set: | ||
| txtPrefix: "test-prefix" | ||
| txtSuffix: "test-suffix" | ||
| txtOwnerId: "testing" | ||
| asserts: | ||
| - failedTemplate: | ||
| errorMessage: "'txtPrefix' and 'txtSuffix' mutually exclusive" | ||
|
|
||
| - it: should not fail when txtPrefix is set | ||
| templates: | ||
| - validation.tpl | ||
| set: | ||
| txtPrefix: "test-prefix" | ||
| txtSuffix: "" | ||
| asserts: | ||
| - notFailedTemplate: {} | ||
|
|
||
| - it: should not fail when txtSuffix is set | ||
| templates: | ||
| - validation.tpl | ||
| set: | ||
| txtSuffix: "abrakadabra" | ||
| asserts: | ||
| - notFailedTemplate: {} | ||
|
|
||
| - it: should not fail with default values | ||
| templates: | ||
| - validation.tpl | ||
| asserts: | ||
| - notFailedTemplate: {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for the sake of simplicity this should be linked together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense. Refactored and added test