whitespace unification

git diff -b shows no difference
parent 056e7261
......@@ -45,8 +45,8 @@ import selector;
probe vk8s_probe_varnish {
.request = "HEAD /vk8s_cluster_health HTTP/1.1"
"Host: vk8s_cluster"
"Connection: close";
"Host: vk8s_cluster"
"Connection: close";
{{- if .Probe }}
{{- if .Probe.Timeout}}
.timeout = {{.Probe.Timeout}};
......@@ -117,14 +117,14 @@ sub vcl_recv {
if (
{{- range $cidx, $cond := $rule.Conditions}}
{{- if ne $cidx 0}} &&
{{end}}
{{end}}
{{- if .Negate}}! {{end}}
{{- if condNeedsMatcher $cond}}
{{- condMatcher $ridx $cidx}}.{{match .Compare}}({{.Comparand}})
{{- else if exists .Compare}}
{{- .Comparand}}
{{- else}}
{{- .Comparand}} {{cmpRelation .Compare .Negate}} {{value $cond}}
{{- .Comparand}} {{cmpRelation .Compare .Negate}} {{value $cond}}
{{- end}}
{{- end -}}
) {
......@@ -169,7 +169,7 @@ sub vcl_recv {
}
sub vk8s_cluster_fetch {
if (bereq.retries > 0
if (bereq.retries > 0
|| bereq.uncacheable
|| remote.ip ~ vk8s_cluster_acl
|| "" + vk8s_cluster.backend(resolve=NOW) == server.identity) {
......@@ -178,14 +178,14 @@ sub vk8s_cluster_fetch {
{{ range $ridx, $rule := .Rules -}}
{{ ifElseIf $ridx (len $.Rules) $rule }}
{{ if not $rule.PrimaryOnly }}
{{- range $cidx, $cond := $rule.Conditions}}
{{- if .Negate}}! {{end}}
{{- if condNeedsMatcher $cond}}
{{- condMatcher $ridx $cidx}}.{{match .Compare}}({{ctx 'b' .Comparand}})
{{- else if exists .Compare}}
{{- ctx 'b' .Comparand}}
{{- else}}
{{- ctx 'b' .Comparand}} {{cmpRelation .Compare .Negate}} {{value $cond}}
{{- range $cidx, $cond := $rule.Conditions}}
{{- if .Negate}}! {{end}}
{{- if condNeedsMatcher $cond}}
{{- condMatcher $ridx $cidx}}.{{match .Compare}}({{ctx 'b' .Comparand}})
{{- else if exists .Compare}}
{{- ctx 'b' .Comparand}}
{{- else}}
{{- ctx 'b' .Comparand}} {{cmpRelation .Compare .Negate}} {{value $cond}}
{{- end}}
{{- end}}
{{ closeIf $rule }}
......@@ -216,15 +216,15 @@ sub vcl_backend_fetch {
sub vcl_backend_response {
if (bereq.backend == vk8s_cluster.backend(resolve=LAZY)) {
if (beresp.http.VK8S-Cluster-TTL) {
set beresp.ttl = std.duration(
beresp.http.VK8S-Cluster-TTL + "s", 1s);
if (beresp.ttl > {{.MaxSecondaryTTL}}) {
set beresp.ttl = {{.MaxSecondaryTTL}};
}
unset beresp.http.VK8S-Cluster-TTL;
}
else {
if (beresp.http.VK8S-Cluster-TTL) {
set beresp.ttl = std.duration(
beresp.http.VK8S-Cluster-TTL + "s", 1s);
if (beresp.ttl > {{.MaxSecondaryTTL}}) {
set beresp.ttl = {{.MaxSecondaryTTL}};
}
unset beresp.http.VK8S-Cluster-TTL;
}
else {
set beresp.uncacheable = true;
}
return (deliver);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment