fix external service type check (#1246)
This commit is contained in:
parent
c53968e5c4
commit
614ed4c80d
3 changed files with 5 additions and 3 deletions
|
@ -288,6 +288,7 @@ var svcIndex = map[string][]*api.Service{
|
||||||
Protocol: "tcp",
|
Protocol: "tcp",
|
||||||
Port: 80,
|
Port: 80,
|
||||||
}},
|
}},
|
||||||
|
Type: api.ServiceTypeExternalName,
|
||||||
},
|
},
|
||||||
}},
|
}},
|
||||||
}
|
}
|
||||||
|
|
|
@ -418,16 +418,15 @@ func (k *Kubernetes) findServices(r recordRequest, zone string) (services []msg.
|
||||||
}
|
}
|
||||||
|
|
||||||
// External service
|
// External service
|
||||||
if svc.Spec.ExternalName != "" {
|
if svc.Spec.Type == api.ServiceTypeExternalName {
|
||||||
s := msg.Service{Key: strings.Join([]string{zonePath, Svc, svc.Namespace, svc.Name}, "/"), Host: svc.Spec.ExternalName, TTL: k.ttl}
|
s := msg.Service{Key: strings.Join([]string{zonePath, Svc, svc.Namespace, svc.Name}, "/"), Host: svc.Spec.ExternalName, TTL: k.ttl}
|
||||||
if t, _ := s.HostType(); t == dns.TypeCNAME {
|
if t, _ := s.HostType(); t == dns.TypeCNAME {
|
||||||
s.Key = strings.Join([]string{zonePath, Svc, svc.Namespace, svc.Name}, "/")
|
s.Key = strings.Join([]string{zonePath, Svc, svc.Namespace, svc.Name}, "/")
|
||||||
services = append(services, s)
|
services = append(services, s)
|
||||||
|
|
||||||
err = nil
|
err = nil
|
||||||
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClusterIP service
|
// ClusterIP service
|
||||||
|
|
|
@ -101,6 +101,7 @@ func (APIConnServiceTest) SvcIndex(string) []*api.Service {
|
||||||
Protocol: "tcp",
|
Protocol: "tcp",
|
||||||
Port: 80,
|
Port: 80,
|
||||||
}},
|
}},
|
||||||
|
Type: api.ServiceTypeExternalName,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -144,6 +145,7 @@ func (APIConnServiceTest) ServiceList() []*api.Service {
|
||||||
Protocol: "tcp",
|
Protocol: "tcp",
|
||||||
Port: 80,
|
Port: 80,
|
||||||
}},
|
}},
|
||||||
|
Type: api.ServiceTypeExternalName,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue