fix router type

This commit is contained in:
jeff
2018-07-01 15:16:46 +08:00
parent d1c5693e1a
commit 08fd9c7f77
3 changed files with 57 additions and 28 deletions

View File

@@ -83,6 +83,18 @@ func (ctl *ServiceCtl) generateObject(item v1.Service) *Service {
createTime = time.Now()
}
if len(item.Spec.ClusterIP) == 0 {
if len(item.Spec.Selector) == 0 {
serviceType = "Headless(Selector)"
}
if item.Spec.Type == v1.ServiceTypeExternalName {
serviceType = "Headless(ExternalName)"
}
} else {
serviceType = "Virtual IP"
}
if len(item.Spec.ExternalIPs) > 0 {
externalIp = strings.Join(item.Spec.ExternalIPs, ",")
}