Commit 7be8865c authored by Geoff Simmons's avatar Geoff Simmons

Fix VCL errors in the template for primary-only self-sharding.

parent b420e67a
......@@ -52,7 +52,7 @@ sub vcl_recv {
if (remote.ip !~ vk8s_cluster_acl
&& "" + vk8s_cluster.backend(resolve=NOW) != server.identity) {
set req.http.VK8S-Shard-Primary-Only = "true";
set req.backend_hint = cluster.backend(resolve=NOW);
set req.backend_hint = vk8s_cluster.backend(resolve=NOW);
return (pass);
}
else {{ end }}if (remote.ip ~ vk8s_cluster_acl) {
......@@ -77,7 +77,7 @@ sub vcl_recv {
{{ if .PrimaryOnly }}
sub vcl_pass {
if (req.http.VK8S-Shard-Primary-Only) {
return (pass);
return (fetch);
}
}
{{ end }}
......@@ -127,7 +127,7 @@ sub vcl_backend_error {
sub vcl_deliver {
{{- if .PrimaryOnly }}
if (bereq.http.VK8S-Shard-Primary-Only) {
if (req.http.VK8S-Shard-Primary-Only) {
return (deliver);
}
{{- end }}
......
......@@ -50,7 +50,7 @@ sub vcl_recv {
if (remote.ip !~ vk8s_cluster_acl
&& "" + vk8s_cluster.backend(resolve=NOW) != server.identity) {
set req.http.VK8S-Shard-Primary-Only = "true";
set req.backend_hint = cluster.backend(resolve=NOW);
set req.backend_hint = vk8s_cluster.backend(resolve=NOW);
return (pass);
}
else if (remote.ip ~ vk8s_cluster_acl) {
......@@ -75,7 +75,7 @@ sub vcl_recv {
sub vcl_pass {
if (req.http.VK8S-Shard-Primary-Only) {
return (pass);
return (fetch);
}
}
......@@ -120,7 +120,7 @@ sub vcl_backend_error {
}
sub vcl_deliver {
if (bereq.http.VK8S-Shard-Primary-Only) {
if (req.http.VK8S-Shard-Primary-Only) {
return (deliver);
}
unset resp.http.VK8S-Cluster-TTL;
......
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