From 59ac07ab0d8cc98b0befd28d5a6a5f12b09263f0 Mon Sep 17 00:00:00 2001 From: Ondrej Kokes Date: Thu, 23 Feb 2023 18:23:41 +0100 Subject: [PATCH] Call MarshalJSON explictly to be on the safe side Since the method won't be called implicitly unless I make the filter into a pointer. This ensures we'll always call our override. --- cloud/linode/loadbalancers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/linode/loadbalancers.go b/cloud/linode/loadbalancers.go index dd27f77d..fb86fe5d 100644 --- a/cloud/linode/loadbalancers.go +++ b/cloud/linode/loadbalancers.go @@ -450,9 +450,9 @@ func (l *loadbalancers) getNodeBalancerByHostname(ctx context.Context, service * } func (l *loadbalancers) getNodeBalancerByIPv4(ctx context.Context, service *v1.Service, ipv4 string) (*linodego.NodeBalancer, error) { - f := linodego.Filter{} + f := &linodego.Filter{} f.AddField(linodego.Eq, "ipv4", ipv4) - filter, err := json.Marshal(f) + filter, err := f.MarshalJSON() if err != nil { return nil, err }