@@ -40,11 +40,13 @@ func (c *clientNative) SyncBackendSrvs(oldEndpoints, newEndpoints *store.PortEnd
40
40
newEndpoints .BackendName = oldEndpoints .BackendName
41
41
haproxySrvs := newEndpoints .HAProxySrvs
42
42
newAddresses := newEndpoints .AddrNew
43
+ portChanged := newEndpoints .Port != oldEndpoints .Port
43
44
// Disable stale entries from HAProxySrvs
44
45
// and provide list of Disabled Srvs
45
46
var disabled []* store.HAProxySrv
46
47
var errors utils.Errors
47
48
for i , srv := range haproxySrvs {
49
+ srv .Modified = portChanged || srv .Modified
48
50
if _ , ok := newAddresses [srv .Address ]; ok {
49
51
delete (newAddresses , srv .Address )
50
52
} else {
@@ -76,7 +78,7 @@ func (c *clientNative) SyncBackendSrvs(oldEndpoints, newEndpoints *store.PortEnd
76
78
stateErr = c .SetServerState (newEndpoints .BackendName , srv .Name , "maint" )
77
79
} else {
78
80
// logger.Tracef("server '%s/%s' changed status to %v", newEndpoints.BackendName, srv.Name, "ready")
79
- addrErr = c .SetServerAddr (newEndpoints .BackendName , srv .Name , srv .Address , 0 )
81
+ addrErr = c .SetServerAddr (newEndpoints .BackendName , srv .Name , srv .Address , int ( newEndpoints . Port ) )
80
82
stateErr = c .SetServerState (newEndpoints .BackendName , srv .Name , "ready" )
81
83
}
82
84
if addrErr != nil || stateErr != nil {
0 commit comments