code: func (c *kregistry) GetService(name string) ([]*registry.Service, error) {
  	pods, err := c.client.ListPods(map[string]string{
  		svcSelectorPrefix + serviceName(name): svcSelectorValue,
  	})
  	if err != nil {
  		return nil, err
  	}
  
  	if len(pods.Items) == 0 {
  		return nil, registry.ErrNotFound
  	}
  
  	// svcs mapped by version
  	svcs := make(map[string]*registry.Service)
  
  	// loop through items
  	for _, pod := range pods.Items {
  		if pod.Status.Phase != podRunning {
  			continue
  		}
  		// get serialised service from annotation
  		svcStr, ok := pod.Metadata.Annotations[annotationServiceKeyPrefix+serviceName(name)]
  		if !ok {
  			continue
  		}
  
  		// unmarshal service string
  		var svc registry.Service
  		err := json.Unmarshal([]byte(*svcStr), &svc)
  		if err != nil {
  			return nil, fmt.Errorf("could not unmarshal service '%s' from pod annotation", name)
  		}
  
  		// merge up pod service & ip with versioned service.
  		vs, ok := svcs[svc.Version]
  		if !ok {
  			svcs[svc.Version] = &svc
  			continue
  		}
  
  		vs.Nodes = append(vs.Nodes, svc.Nodes...)
  	}
  
  	var list []*registry.Service
  	for _, val := range svcs {
  		list = append(list, val)
  	}
  	return list, nil
  }
docs: // GetService will get all the pods with the given service selector,
  // and build services from the annotations.