mirror of
https://github.com/truenas/charts.git
synced 2026-06-16 15:08:11 +08:00
another case
This commit is contained in:
@@ -217,6 +217,29 @@ tests:
|
||||
- failedTemplate:
|
||||
errorMessage: Container - Expected non-empty <lifecycle> <port> on [http] type
|
||||
|
||||
- it: should fail with path not starting with / on http lifecycle type
|
||||
set:
|
||||
image: *image
|
||||
workload:
|
||||
workload-name:
|
||||
enabled: true
|
||||
primary: true
|
||||
type: Deployment
|
||||
podSpec:
|
||||
containers:
|
||||
container-name1:
|
||||
enabled: true
|
||||
primary: true
|
||||
imageSelector: image
|
||||
lifecycle:
|
||||
preStop:
|
||||
type: http
|
||||
port: 80
|
||||
path: "api/v1"
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: Container - Expected <path> to start with a forward slash [/] on <http> type
|
||||
|
||||
- it: should fail with empty value on httpHeaders on http lifecycle type
|
||||
set:
|
||||
image: *image
|
||||
|
||||
@@ -15,9 +15,15 @@ objectData: The object data to be used to render the container.
|
||||
{{- if kindIs "string" $port -}}
|
||||
{{- $port = tpl $port $rootCtx -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with $objectData.path -}}
|
||||
{{- $path = tpl . $rootCtx -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if not (hasPrefix "/" $path) -}}
|
||||
{{- fail "Container - Expected <path> to start with a forward slash [/] on <http> type" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with $objectData.scheme -}}
|
||||
{{- $scheme = tpl . $rootCtx -}}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user