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

Convert the primaryOnly field from VarnishConfig to VCL.

parent 7be8865c
......@@ -61,8 +61,9 @@ type VarnishConfigSpec struct {
// SelfShardSpec specifies self-sharding in a Varnish cluster.
// see: https://code.uplex.de/uplex-varnish/k8s-ingress/blob/master/docs/self-sharding.md
type SelfShardSpec struct {
Max2ndTTL string `json:"max-secondary-ttl,omitempty"`
Probe ProbeSpec `json:"probe,omitempty"`
Max2ndTTL string `json:"max-secondary-ttl,omitempty"`
Probe ProbeSpec `json:"probe,omitempty"`
PrimaryOnly bool `json:"primaryOnly,omitempty"`
}
// ProbeSpec specifies health probes for self-sharding and BackendConfig.
......
......@@ -583,6 +583,7 @@ func (worker *NamespaceWorker) configSharding(spec *vcl.Spec,
cfgSpec := vcfg.Spec.SelfSharding
probe := getVCLProbe(&cfgSpec.Probe)
spec.ShardCluster.Probe = *probe
spec.ShardCluster.PrimaryOnly = cfgSpec.PrimaryOnly
if cfgSpec.Max2ndTTL != "" {
spec.ShardCluster.MaxSecondaryTTL = cfgSpec.Max2ndTTL
} else {
......
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