Fix kubernetes compile issues

This commit is contained in:
Asim 2015-04-03 00:30:18 +02:00
parent c7e114fa19
commit f2daa02256
2 changed files with 5 additions and 3 deletions

View File

@ -38,7 +38,9 @@ func (c *KubernetesRegistry) GetService(name string) (Service, error) {
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 {
return nil, err
}
@ -51,7 +53,7 @@ func (c *KubernetesRegistry) GetService(name string) (Service, error) {
for _, item := range services.Items {
ks.ServiceNodes = append(ks.ServiceNodes, &KubernetesNode{
NodeAddress: item.Spec.PortalIP,
NodePort: item.Spec.Port,
NodePort: item.Spec.Ports[0].Port,
})
}

View File

@ -32,7 +32,7 @@ func (k *KubernetesWatcher) OnUpdate(services []api.Service) {
ServiceNodes: []*KubernetesNode{
&KubernetesNode{
NodeAddress: serviceIP.String(),
NodePort: service.Spec.Port,
NodePort: service.Spec.Ports[0].Port,
},
},
}