mw/kubernetes: remove subzones (#878)
Only use was in k8s middleware; no tests other than subzone_test.go existed; not exercised: remove.
This commit is contained in:
parent
4d0dae8deb
commit
10681c6bf0
3 changed files with 7 additions and 85 deletions
|
@ -68,14 +68,16 @@ func kubernetesParse(c *caddy.Controller) (*Kubernetes, error) {
|
|||
if c.Val() == "kubernetes" {
|
||||
zones := c.RemainingArgs()
|
||||
|
||||
if len(zones) == 0 {
|
||||
if len(zones) != 0 {
|
||||
k8s.Zones = zones
|
||||
middleware.Zones(k8s.Zones).Normalize()
|
||||
} else {
|
||||
k8s.Zones = make([]string, len(c.ServerBlockKeys))
|
||||
copy(k8s.Zones, c.ServerBlockKeys)
|
||||
for i := 0; i < len(c.ServerBlockKeys); i++ {
|
||||
k8s.Zones[i] = middleware.Host(c.ServerBlockKeys[i]).Normalize()
|
||||
}
|
||||
}
|
||||
|
||||
k8s.Zones = NormalizeZoneList(zones)
|
||||
middleware.Zones(k8s.Zones).Normalize()
|
||||
|
||||
if k8s.Zones == nil || len(k8s.Zones) < 1 {
|
||||
return nil, errors.New("zone name must be provided for kubernetes middleware")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue