From ff034f5f68589f7b112bce90295febef3c9801d6 Mon Sep 17 00:00:00 2001 From: Karthikeyan Govindaraj <30545166+gkarthiks@users.noreply.github.com> Date: Tue, 28 Jul 2020 12:41:30 +0530 Subject: [PATCH] fix: logic to avoid addons --- helper/util.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/helper/util.go b/helper/util.go index 5b3023e..95c9dce 100644 --- a/helper/util.go +++ b/helper/util.go @@ -67,12 +67,12 @@ func populateIpAddresses(podsList *v1.PodList, vaultPool *types.VaultPool) { currentPodNames[pod.Name] = struct{}{} if pod.Status.Phase == v1.PodRunning { // adding the currently discovered pod ips - globals.VaultIPList[pod.Name] = pod.Status.PodIP - //if _, ok := globals.VaultIPList[pod.Status.PodIP]; ok { - // log.Infof("%v already added", pod.Status.PodIP) - //} else { - // globals.VaultIPList[pod.Status.PodIP] = struct{}{} - //} + //globals.VaultIPList[pod.Name] = pod.Status.PodIP + if _, ok := globals.VaultIPList[pod.Name]; ok { + log.Infof("%v already added and configured", pod.Name) + } else { + globals.VaultIPList[pod.Name] = pod.Status.PodIP + } } } for historyPodName, ipAddress := range globals.VaultIPList {