Skip to content

Commit

Permalink
Fix runtime not update state
Browse files Browse the repository at this point in the history
  • Loading branch information
mlophez committed Sep 24, 2024
1 parent 66dc4c5 commit 20bceda
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/haproxy/api/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/haproxytech/kubernetes-ingress/pkg/store"
"github.com/haproxytech/kubernetes-ingress/pkg/utils"
"github.com/haproxytech/kubernetes-ingress/pkg/zone"
)

var ErrMapNotFound = fmt.Errorf("map not found")
Expand Down Expand Up @@ -130,7 +131,11 @@ func (c *clientNative) SyncBackendSrvs(backend *store.RuntimeBackend, portUpdate
} else {
logger.Tracef("[RUNTIME] [BACKEND] [SERVER] [SOCKET] backend %s: server '%s': addr '%s' changed status to %v", backend.Name, srv.Name, srv.Address, "ready")
addrErr = c.SetServerAddr(backend.Name, srv.Name, srv.Address, int(backend.Endpoints.Port))
stateErr = c.SetServerState(backend.Name, srv.Name, "ready")
if zone.IsBackupEnabledForThisIP(srv.Address) {
stateErr = c.SetServerState(backend.Name, srv.Name, "backup")
} else {
stateErr = c.SetServerState(backend.Name, srv.Name, "ready")
}
}
if addrErr != nil || stateErr != nil {
backend.DynUpdateFailed = true
Expand Down

0 comments on commit 20bceda

Please sign in to comment.