diff --git a/library/common-test/tests/container_in_deployment/probe_test.yaml b/library/common-test/tests/container_in_deployment/probe_test.yaml index c7bc90b973..2d857d1ca6 100644 --- a/library/common-test/tests/container_in_deployment/probe_test.yaml +++ b/library/common-test/tests/container_in_deployment/probe_test.yaml @@ -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: diff --git a/library/common/1.0.0/templates/lib/container/_probes.tpl b/library/common/1.0.0/templates/lib/container/_probes.tpl index adf303b858..d7d61cc1b5 100644 --- a/library/common/1.0.0/templates/lib/container/_probes.tpl +++ b/library/common/1.0.0/templates/lib/container/_probes.tpl @@ -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 -}}