From bb95143369c47aa03523368549fb01484882e853 Mon Sep 17 00:00:00 2001 From: Andrew Sy Kim Date: Thu, 13 Jun 2019 18:51:50 -0400 Subject: [PATCH] ipvs: fix string check for IPVS protocol during graceful termination Signed-off-by: Andrew Sy Kim --- pkg/proxy/ipvs/graceful_termination.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/proxy/ipvs/graceful_termination.go b/pkg/proxy/ipvs/graceful_termination.go index 93dfc8b1fde..84e818f14f4 100644 --- a/pkg/proxy/ipvs/graceful_termination.go +++ b/pkg/proxy/ipvs/graceful_termination.go @@ -18,6 +18,7 @@ package ipvs import ( "fmt" + "strings" "sync" "time" @@ -167,7 +168,7 @@ func (m *GracefulTerminationManager) deleteRsFunc(rsToDelete *listItem) (bool, e // For UDP traffic, no graceful termination, we immediately delete the RS // (existing connections will be deleted on the next packet because sysctlExpireNoDestConn=1) // For other protocols, don't delete until all connections have expired) - if rsToDelete.VirtualServer.Protocol != "udp" && rs.ActiveConn+rs.InactiveConn != 0 { + if strings.ToUpper(rsToDelete.VirtualServer.Protocol) != "UDP" && rs.ActiveConn+rs.InactiveConn != 0 { klog.Infof("Not deleting, RS %v: %v ActiveConn, %v InactiveConn", rsToDelete.String(), rs.ActiveConn, rs.InactiveConn) return false, nil }