From 50af8a8a2754817f56be27527df6f9401d492236 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Wed, 13 Apr 2016 12:44:55 -0700 Subject: [PATCH] Don't set service.vip for headless k8s service --- kubernetesevents/generic_handler.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kubernetesevents/generic_handler.go b/kubernetesevents/generic_handler.go index 688b5c2..07b02b7 100644 --- a/kubernetesevents/generic_handler.go +++ b/kubernetesevents/generic_handler.go @@ -105,7 +105,10 @@ func (h *GenericHandler) add(selectorMap map[string]interface{}, metadata *model data := map[string]interface{}{"fields": fields} rancherUuid, _ := metadata.Labels["io.rancher.uuid"].(string) - + var vip string + if !strings.EqualFold(clusterIp, "None") { + vip = clusterIp + } service := client.Service{ Kind: kind, Name: metadata.Name, @@ -113,7 +116,7 @@ func (h *GenericHandler) add(selectorMap map[string]interface{}, metadata *model SelectorContainer: selector, Data: data, Uuid: rancherUuid, - Vip: clusterIp, + Vip: vip, } serviceEvent.Service = service