Fix kubernetes compile issues
This commit is contained in:
parent
c7e114fa19
commit
f2daa02256
@ -38,7 +38,9 @@ func (c *KubernetesRegistry) GetService(name string) (Service, error) {
|
|||||||
return service, nil
|
return service, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
services, err := c.Client.Services(c.Namespace).List(labels.OneTermEqualSelector("name", name))
|
selector := labels.SelectorFromSet(labels.Set{"name": name})
|
||||||
|
|
||||||
|
services, err := c.Client.Services(c.Namespace).List(selector)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -51,7 +53,7 @@ func (c *KubernetesRegistry) GetService(name string) (Service, error) {
|
|||||||
for _, item := range services.Items {
|
for _, item := range services.Items {
|
||||||
ks.ServiceNodes = append(ks.ServiceNodes, &KubernetesNode{
|
ks.ServiceNodes = append(ks.ServiceNodes, &KubernetesNode{
|
||||||
NodeAddress: item.Spec.PortalIP,
|
NodeAddress: item.Spec.PortalIP,
|
||||||
NodePort: item.Spec.Port,
|
NodePort: item.Spec.Ports[0].Port,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ func (k *KubernetesWatcher) OnUpdate(services []api.Service) {
|
|||||||
ServiceNodes: []*KubernetesNode{
|
ServiceNodes: []*KubernetesNode{
|
||||||
&KubernetesNode{
|
&KubernetesNode{
|
||||||
NodeAddress: serviceIP.String(),
|
NodeAddress: serviceIP.String(),
|
||||||
NodePort: service.Spec.Port,
|
NodePort: service.Spec.Ports[0].Port,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user