Skip to content

Commit 633fdc1

Browse files
corrected the regular expression
1 parent 0d9ec54 commit 633fdc1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

images/router/haproxy/conf/haproxy-config.template

+3-3
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ backend be_edge_http_{{$cfgIdx}}
227227
balance leastconn
228228
{{ end }}
229229
{{ with $value := index $cfg.Annotations "router.openshift.io/haproxy.timeout"}}
230-
{{if (matchString "[0-9]*(us|ms|s|m|h|d)?" $value) }}
230+
{{if (matchString "^[1-9][0-9]*(us|ms|s|m|h|d)?$" $value) }}
231231
timeout server {{$value}}
232232
{{ end }}
233233
{{ end }}
@@ -265,7 +265,7 @@ backend be_tcp_{{$cfgIdx}}
265265
balance {{ env "ROUTER_TCP_BALANCE_SCHEME" "source" }}
266266
{{ end }}
267267
{{ with $value := index $cfg.Annotations "router.openshift.io/haproxy.timeout"}}
268-
{{if (matchString "[0-9]*(us|ms|s|m|h|d)?" $value) }}
268+
{{if (matchString "^[1-9][0-9]*(us|ms|s|m|h|d)?$" $value) }}
269269
timeout server {{$value}}
270270
{{ end }}
271271
{{ end }}
@@ -293,7 +293,7 @@ backend be_secure_{{$cfgIdx}}
293293
balance leastconn
294294
{{ end }}
295295
{{ with $value := index $cfg.Annotations "router.openshift.io/haproxy.timeout"}}
296-
{{if (matchString "[0-9]*(us|ms|s|m|h|d)?" $value) }}
296+
{{if (matchString "^[1-9][0-9]*(us|ms|s|m|h|d)?$" $value) }}
297297
timeout server {{$value}}
298298
{{ end }}
299299
{{ end }}

0 commit comments

Comments
 (0)