diff --git a/pkg/loadbalancer/stream/loadbalancer.go b/pkg/loadbalancer/stream/loadbalancer.go index 95fb748f..45494129 100644 --- a/pkg/loadbalancer/stream/loadbalancer.go +++ b/pkg/loadbalancer/stream/loadbalancer.go @@ -433,7 +433,7 @@ func (lb *LoadBalancer) verifyTargets() { } err := lb.RemoveTarget(target.GetIdentifier()) if err != nil { - lb.logger.Error(err, "deleting target", "target", target.GetIdentifier()) + lb.logger.Error(err, "deleting target", "target", target) } lb.addPendingTarget(target) } diff --git a/pkg/loadbalancer/stream/target.go b/pkg/loadbalancer/stream/target.go index d1b022d3..21ea3d1b 100644 --- a/pkg/loadbalancer/stream/target.go +++ b/pkg/loadbalancer/stream/target.go @@ -17,6 +17,7 @@ limitations under the License. package stream import ( + "encoding/json" "errors" "fmt" "strconv" @@ -102,3 +103,14 @@ func (t *target) Delete() error { t.fwMarks = []networking.FWMarkRoute{} return errFinal } +func (t *target) MarshalJSON() ([]byte, error) { + ts := struct { + Identifier int `json:"identifier"` + IPs []string `json:"ips"` + }{ + t.identifier, + t.nspTarget.GetIps(), + } + return json.Marshal(&ts) +} +