From d95baad2e1a83cf2b4d8b946f76851fdb78797b1 Mon Sep 17 00:00:00 2001 From: Arihant Bachhawat Date: Thu, 7 Nov 2024 12:33:01 +0530 Subject: [PATCH] AV-221733 update publicIP on pool member update --- gslb/nodes/avi_model_nodes.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gslb/nodes/avi_model_nodes.go b/gslb/nodes/avi_model_nodes.go index 6c4a6161..6ca176b7 100644 --- a/gslb/nodes/avi_model_nodes.go +++ b/gslb/nodes/avi_model_nodes.go @@ -878,6 +878,7 @@ func BuildGSMemberObjFromMeta(metaObj k8sobjects.MetaObject, gsFqdn string, gsDo weight := int32(-1) priority := int32(-1) + publicIP := "" cname := metaObj.GetCluster() ns := metaObj.GetNamespace() objType := metaObj.GetType() @@ -902,7 +903,12 @@ func BuildGSMemberObjFromMeta(metaObj k8sobjects.MetaObject, gsFqdn string, gsDo if priority == -1 { priority = int32(GetObjTrafficPriority(ns, cname)) } - + // determine the GS member's PublicIP + for _, c := range ghRules.PublicIP { + if c.Cluster == cname { + publicIP = c.IP + } + } paths, err := metaObj.GetPaths() if err != nil { // for LB type services and passthrough routes @@ -938,6 +944,7 @@ func BuildGSMemberObjFromMeta(metaObj k8sobjects.MetaObject, gsFqdn string, gsDo SyncVIPOnly: syncVIPOnly, IsPassthrough: metaObj.IsPassthrough(), TLS: tls, + PublicIP: publicIP, Tenant: metaObj.GetTenant(), }, nil }