UDP is not a valid probe type + update error message

This commit is contained in:
Stavros kois
2022-12-02 13:30:48 +02:00
parent e1fd7d864d
commit 609152a760
2 changed files with 5 additions and 5 deletions
@@ -159,7 +159,7 @@ tests:
type: not_valid_type
asserts:
- failedTemplate:
errorMessage: Invalid probe type (not_valid_type) on probe (liveness)
errorMessage: Invalid probe type (not_valid_type) on probe (liveness). Valid types are TCP, HTTP, HTTPS, GRPC, EXEC
- it: should fail with httpHeader value is defined as list
set:
@@ -22,15 +22,15 @@
{{- else -}}
{{- if and $primaryService $primaryPort -}}
{{- if $probe.type -}}
{{- if eq $probe.type "AUTO" -}}
{{- if eq $probe.type "AUTO" -}} {{/* Get probeType based on the service protocol */}}
{{- $probeType = $primaryPort.protocol -}}
{{- else -}}
{{- if not (has $probe.type (list "TCP" "HTTP" "HTTPS" "GRPC" "UDP")) -}}
{{- fail (printf "Invalid probe type (%s) on probe (%s)" $probe.type $probeName) -}}
{{- if not (has $probe.type (list "TCP" "HTTP" "HTTPS" "GRPC")) -}} {{/* Make sure there is a valid probe type defined */}}
{{- fail (printf "Invalid probe type (%s) on probe (%s). Valid types are TCP, HTTP, HTTPS, GRPC, EXEC" $probe.type $probeName) -}}
{{- end -}}
{{- $probeType = $probe.type -}}
{{- end -}}
{{- else -}}
{{- else -}} {{/* Fail back to defaultProbeType if no type is defined */}}
{{- $probeType := $defaultProbeType -}}
{{- end -}}
{{- else -}}