mirror of
https://github.com/truenas/charts.git
synced 2024-04-21 15:21:45 +00:00
add an error for edge case
This commit is contained in:
@@ -48,6 +48,17 @@ tests:
|
||||
- failedTemplate:
|
||||
errorMessage: Workload - Expected <type> to be one of [Deployment, StatefulSet, DaemonSet, Job, CronJob], but got [not-valid-type]
|
||||
|
||||
- it: should fail without podSpec
|
||||
set:
|
||||
workload:
|
||||
workload-name:
|
||||
enabled: true
|
||||
primary: true
|
||||
type: Deployment
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: Workload - Expected <podSpec> key to exist
|
||||
|
||||
- it: should fail without primary enabled workload
|
||||
set:
|
||||
workload:
|
||||
@@ -63,7 +74,7 @@ tests:
|
||||
podSpec: {}
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: Workload - At least one enabled workload must be primary
|
||||
errorMessage: Workload - One enabled workload must be primary
|
||||
|
||||
- it: should fail more than one primary enabled workload
|
||||
set:
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
{{/* Set the podSpec so it doesn't fail on nil pointer */}}
|
||||
{{- if not (hasKey $objectData "podSpec") -}}
|
||||
{{ $_ := set $objectData "podSpec" dict }}
|
||||
{{- fail "Workload - Expeced <podSpec> key to exist" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Call class to create the object */}}
|
||||
|
||||
Reference in New Issue
Block a user