From a33add8000724be9cc8be236893d5f7aa822dfba Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 28 Feb 2020 03:18:38 -0500 Subject: [PATCH] fix: rename method and add comment --- plugins/proxy/proxy.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/proxy/proxy.go b/plugins/proxy/proxy.go index 35ab61ebc..70a4406fb 100644 --- a/plugins/proxy/proxy.go +++ b/plugins/proxy/proxy.go @@ -24,7 +24,8 @@ func (p PortMap) String() string { return fmt.Sprintf("%s:%d:%d", p.Scheme, p.HostPort, p.ContainerPort) } -func (p PortMap) IsInternal() bool { +// AllowsPersistence returns true if the port map is not to be persisted +func (p PortMap) AllowsPersistence() bool { return p.Scheme == "__internal__" } @@ -141,7 +142,7 @@ func listAppProxyPorts(appName string) error { func setProxyPorts(appName string, proxyPortMap []PortMap) error { var value []string for _, portMap := range uniqueProxyPortMap(proxyPortMap) { - if portMap.IsInternal() { + if portMap.AllowsPersistence() { continue } @@ -160,7 +161,7 @@ func removeProxyPorts(appName string, proxyPortMap []PortMap) error { toRemoveByPort := map[int]bool{} for _, portMap := range proxyPortMap { - if portMap.IsInternal() { + if portMap.AllowsPersistence() { toRemoveByPort[portMap.HostPort] = true continue }