Skip to content

Commit 77b4a74

Browse files
deps: update module github.com/hetznercloud/hcloud-go/v2 to v2.13.1 (#628)
1 parent a38a8a3 commit 77b4a74

File tree

14 files changed

+110
-150
lines changed

14 files changed

+110
-150
lines changed

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.22.0
55
toolchain go1.22.6
66

77
require (
8-
github.com/hetznercloud/hcloud-go/v2 v2.6.0
8+
github.com/hetznercloud/hcloud-go/v2 v2.13.1
99
github.com/prometheus/client_golang v1.19.1
1010
github.com/spf13/pflag v1.0.5
1111
github.com/stretchr/testify v1.9.0
@@ -85,13 +85,13 @@ require (
8585
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
8686
go.uber.org/multierr v1.11.0 // indirect
8787
go.uber.org/zap v1.26.0 // indirect
88-
golang.org/x/crypto v0.24.0 // indirect
88+
golang.org/x/crypto v0.25.0 // indirect
8989
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect
90-
golang.org/x/net v0.26.0 // indirect
90+
golang.org/x/net v0.27.0 // indirect
9191
golang.org/x/oauth2 v0.21.0 // indirect
9292
golang.org/x/sync v0.7.0 // indirect
93-
golang.org/x/sys v0.21.0 // indirect
94-
golang.org/x/term v0.21.0 // indirect
93+
golang.org/x/sys v0.22.0 // indirect
94+
golang.org/x/term v0.22.0 // indirect
9595
golang.org/x/text v0.16.0 // indirect
9696
google.golang.org/appengine v1.6.7 // indirect
9797
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect

go.sum

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1
122122
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k=
123123
github.com/hetznercloud/hcloud-go/v2 v2.6.0 h1:RJOA2hHZ7rD1pScA4O1NF6qhkHyUdbbxjHgFNot8928=
124124
github.com/hetznercloud/hcloud-go/v2 v2.6.0/go.mod h1:4J1cSE57+g0WS93IiHLV7ubTHItcp+awzeBp5bM9mfA=
125+
github.com/hetznercloud/hcloud-go/v2 v2.13.1 h1:jq0GP4QaYE5d8xR/Zw17s9qoaESRJMXfGmtD1a/qckQ=
126+
github.com/hetznercloud/hcloud-go/v2 v2.13.1/go.mod h1:dhix40Br3fDiBhwaSG/zgaYOFFddpfBm/6R1Zz0IiF0=
125127
github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4=
126128
github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
127129
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
@@ -290,6 +292,8 @@ golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
290292
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
291293
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
292294
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
295+
golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
296+
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
293297
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
294298
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
295299
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU=
@@ -305,6 +309,8 @@ golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
305309
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
306310
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
307311
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
312+
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
313+
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
308314
golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4=
309315
golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4=
310316
golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
@@ -324,10 +330,14 @@ golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
324330
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
325331
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
326332
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
333+
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
334+
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
327335
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
328336
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
329337
golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA=
330338
golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0=
339+
golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk=
340+
golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4=
331341
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
332342
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
333343
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=

hcloud/cloud_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ func newTestEnv() testEnv {
5959
client := hcloud.NewClient(
6060
hcloud.WithEndpoint(server.URL),
6161
hcloud.WithToken("jr5g7ZHpPptyhJzZyHw2Pqu4g9gTqDvEceYpngPf79jNZXCeTYQ4uArypFM3nh75"),
62-
hcloud.WithBackoffFunc(func(_ int) time.Duration { return 0 }),
62+
hcloud.WithPollOpts(hcloud.PollOpts{BackoffFunc: hcloud.ConstantBackoff(0)}),
63+
hcloud.WithRetryOpts(hcloud.RetryOpts{BackoffFunc: hcloud.ConstantBackoff(0)}),
6364
hcloud.WithDebugWriter(os.Stdout),
6465
)
6566
robotClient := hrobot.NewBasicAuthClient("", "")

hcloud/routes.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func (r *routes) CreateRoute(ctx context.Context, clusterName string, nameHint s
133133
}
134134
action, _, err := r.client.Network.AddRoute(ctx, r.network, opts)
135135
if err != nil {
136-
if hcloud.IsError(err, hcloud.ErrorCodeLocked) || hcloud.IsError(err, hcloud.ErrorCodeConflict) {
136+
if hcloud.IsError(err, hcloud.ErrorCodeLocked, hcloud.ErrorCodeConflict) {
137137
retryDelay := time.Second * 5
138138
klog.InfoS("retry due to conflict or lock",
139139
"op", op, "delay", fmt.Sprintf("%v", retryDelay), "err", fmt.Sprintf("%v", err))
@@ -144,7 +144,7 @@ func (r *routes) CreateRoute(ctx context.Context, clusterName string, nameHint s
144144
return fmt.Errorf("%s: %w", op, err)
145145
}
146146

147-
if err := hcops.WatchAction(ctx, &r.client.Action, action); err != nil {
147+
if err := r.client.Action.WaitFor(ctx, action); err != nil {
148148
return fmt.Errorf("%s: %w", op, err)
149149
}
150150
}
@@ -194,7 +194,7 @@ func (r *routes) deleteRouteFromHcloud(ctx context.Context, cidr *net.IPNet, ip
194194

195195
action, _, err := r.client.Network.DeleteRoute(ctx, r.network, opts)
196196
if err != nil {
197-
if hcloud.IsError(err, hcloud.ErrorCodeLocked) || hcloud.IsError(err, hcloud.ErrorCodeConflict) {
197+
if hcloud.IsError(err, hcloud.ErrorCodeLocked, hcloud.ErrorCodeConflict) {
198198
retryDelay := time.Second * 5
199199
klog.InfoS("retry due to conflict or lock",
200200
"op", op, "delay", fmt.Sprintf("%v", retryDelay), "err", fmt.Sprintf("%v", err))
@@ -204,7 +204,7 @@ func (r *routes) deleteRouteFromHcloud(ctx context.Context, cidr *net.IPNet, ip
204204
}
205205
return fmt.Errorf("%s: %w", op, err)
206206
}
207-
if err := hcops.WatchAction(ctx, &r.client.Action, action); err != nil {
207+
if err := r.client.Action.WaitFor(ctx, action); err != nil {
208208
return fmt.Errorf("%s: %w", op, err)
209209
}
210210
return nil
@@ -262,7 +262,7 @@ func (r *routes) checkIfRouteAlreadyExists(ctx context.Context, route *cloudprov
262262
return false, fmt.Errorf("%s: %w", op, err)
263263
}
264264

265-
if err := hcops.WatchAction(ctx, &r.client.Action, action); err != nil {
265+
if err := r.client.Action.WaitFor(ctx, action); err != nil {
266266
return false, fmt.Errorf("%s: %w", op, err)
267267
}
268268
}

hcloud/routes_test.go

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ func TestRoutes_CreateRoute(t *testing.T) {
4040
},
4141
})
4242
})
43-
env.Mux.HandleFunc("/actions/1", func(w http.ResponseWriter, _ *http.Request) {
44-
json.NewEncoder(w).Encode(schema.NetworkActionAddRouteResponse{
45-
Action: schema.Action{
46-
ID: 1,
47-
Status: string(hcloud.ActionStatusSuccess),
48-
Progress: 100,
43+
env.Mux.HandleFunc("/actions", func(w http.ResponseWriter, _ *http.Request) {
44+
json.NewEncoder(w).Encode(schema.ActionListResponse{
45+
Actions: []schema.Action{
46+
{
47+
ID: 1,
48+
Status: string(hcloud.ActionStatusSuccess),
49+
Progress: 100,
50+
},
4951
},
5052
})
5153
})
@@ -155,12 +157,14 @@ func TestRoutes_DeleteRoute(t *testing.T) {
155157
},
156158
})
157159
})
158-
env.Mux.HandleFunc("/actions/1", func(w http.ResponseWriter, _ *http.Request) {
159-
json.NewEncoder(w).Encode(schema.NetworkActionAddRouteResponse{
160-
Action: schema.Action{
161-
ID: 1,
162-
Status: string(hcloud.ActionStatusSuccess),
163-
Progress: 100,
160+
env.Mux.HandleFunc("/actions", func(w http.ResponseWriter, _ *http.Request) {
161+
json.NewEncoder(w).Encode(schema.ActionListResponse{
162+
Actions: []schema.Action{
163+
{
164+
ID: 1,
165+
Status: string(hcloud.ActionStatusSuccess),
166+
Progress: 100,
167+
},
164168
},
165169
})
166170
})

internal/config/config.go

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import (
55
"fmt"
66
"os"
77
"strconv"
8-
"strings"
98
"time"
9+
10+
"github.com/hetznercloud/hcloud-go/v2/hcloud/exp/kit/envutil"
1011
)
1112

1213
const (
@@ -97,32 +98,6 @@ type HCCMConfiguration struct {
9798
Route RouteConfiguration
9899
}
99100

100-
// read values from environment variables or from file set via _FILE env var
101-
// values set directly via env var take precedence over values set via file.
102-
func readFromEnvOrFile(envVar string) (string, error) {
103-
// check if the value is set directly via env (e.g. HCLOUD_TOKEN)
104-
value, ok := os.LookupEnv(envVar)
105-
if ok {
106-
return value, nil
107-
}
108-
109-
// check if the value is set via a file (e.g. HCLOUD_TOKEN_FILE)
110-
value, ok = os.LookupEnv(envVar + "_FILE")
111-
if !ok {
112-
// return no error here, the values could be optional
113-
// and the function "Validate()" below checks that all required variables are set
114-
return "", nil
115-
}
116-
117-
// read file content
118-
valueBytes, err := os.ReadFile(value)
119-
if err != nil {
120-
return "", fmt.Errorf("failed to read %s: %w", envVar+"_FILE", err)
121-
}
122-
123-
return strings.TrimSpace(string(valueBytes)), nil
124-
}
125-
126101
// Read evaluates all environment variables and returns a [HCCMConfiguration]. It only validates as far as
127102
// it needs to parse the values. For business logic validation, check out [HCCMConfiguration.Validate].
128103
func Read() (HCCMConfiguration, error) {
@@ -133,7 +108,7 @@ func Read() (HCCMConfiguration, error) {
133108
var errs []error
134109
var cfg HCCMConfiguration
135110

136-
cfg.HCloudClient.Token, err = readFromEnvOrFile(hcloudToken)
111+
cfg.HCloudClient.Token, err = envutil.LookupEnvWithFile(hcloudToken)
137112
if err != nil {
138113
errs = append(errs, err)
139114
}
@@ -147,11 +122,11 @@ func Read() (HCCMConfiguration, error) {
147122
if err != nil {
148123
errs = append(errs, err)
149124
}
150-
cfg.Robot.User, err = readFromEnvOrFile(robotUser)
125+
cfg.Robot.User, err = envutil.LookupEnvWithFile(robotUser)
151126
if err != nil {
152127
errs = append(errs, err)
153128
}
154-
cfg.Robot.Password, err = readFromEnvOrFile(robotPassword)
129+
cfg.Robot.Password, err = envutil.LookupEnvWithFile(robotPassword)
155130
if err != nil {
156131
errs = append(errs, err)
157132
}

internal/hcops/action.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,5 @@ import (
77
)
88

99
type HCloudActionClient interface {
10-
WatchProgress(ctx context.Context, a *hcloud.Action) (<-chan int, <-chan error)
11-
}
12-
13-
func WatchAction(ctx context.Context, ac HCloudActionClient, a *hcloud.Action) error {
14-
_, errCh := ac.WatchProgress(ctx, a)
15-
err := <-errCh
16-
return err
10+
WaitFor(ctx context.Context, actions ...*hcloud.Action) error
1711
}

internal/hcops/load_balancer.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func (l *LoadBalancerOps) Create(
225225
if err != nil {
226226
return nil, fmt.Errorf("%s: %w", op, err)
227227
}
228-
if err := WatchAction(ctx, l.ActionClient, result.Action); err != nil {
228+
if err := l.ActionClient.WaitFor(ctx, result.Action); err != nil {
229229
return nil, fmt.Errorf("%s: %w", op, err)
230230
}
231231

@@ -374,7 +374,7 @@ func (l *LoadBalancerOps) changeIPv4RDNS(ctx context.Context, lb *hcloud.LoadBal
374374
if err != nil {
375375
return false, fmt.Errorf("%s: %w", op, err)
376376
}
377-
err = WatchAction(ctx, l.ActionClient, action)
377+
err = l.ActionClient.WaitFor(ctx, action)
378378
if err != nil {
379379
return false, fmt.Errorf("%s: %w", op, err)
380380
}
@@ -399,7 +399,7 @@ func (l *LoadBalancerOps) changeIPv6RDNS(ctx context.Context, lb *hcloud.LoadBal
399399
if err != nil {
400400
return false, fmt.Errorf("%s: %w", op, err)
401401
}
402-
err = WatchAction(ctx, l.ActionClient, action)
402+
err = l.ActionClient.WaitFor(ctx, action)
403403
if err != nil {
404404
return false, fmt.Errorf("%s: %w", op, err)
405405
}
@@ -426,7 +426,7 @@ func (l *LoadBalancerOps) changeAlgorithm(ctx context.Context, lb *hcloud.LoadBa
426426
if err != nil {
427427
return false, fmt.Errorf("%s: %w", op, err)
428428
}
429-
err = WatchAction(ctx, l.ActionClient, action)
429+
err = l.ActionClient.WaitFor(ctx, action)
430430
if err != nil {
431431
return false, fmt.Errorf("%s: %w", op, err)
432432
}
@@ -450,7 +450,7 @@ func (l *LoadBalancerOps) changeType(ctx context.Context, lb *hcloud.LoadBalance
450450
if err != nil {
451451
return false, fmt.Errorf("%s: %w", op, err)
452452
}
453-
err = WatchAction(ctx, l.ActionClient, action)
453+
err = l.ActionClient.WaitFor(ctx, action)
454454
if err != nil {
455455
return false, fmt.Errorf("%s: %w", op, err)
456456
}
@@ -476,7 +476,7 @@ func (l *LoadBalancerOps) detachFromNetwork(ctx context.Context, lb *hcloud.Load
476476
if err != nil {
477477
return changed, fmt.Errorf("%s: %w", op, err)
478478
}
479-
if err := WatchAction(ctx, l.ActionClient, a); err != nil {
479+
if err := l.ActionClient.WaitFor(ctx, a); err != nil {
480480
return changed, fmt.Errorf("%s: %w", op, err)
481481
}
482482
changed = true
@@ -509,7 +509,7 @@ func (l *LoadBalancerOps) attachToNetwork(ctx context.Context, lb *hcloud.LoadBa
509509
}
510510
opts := hcloud.LoadBalancerAttachToNetworkOpts{Network: nw}
511511
a, _, err := l.LBClient.AttachToNetwork(ctx, lb, opts)
512-
if hcloud.IsError(err, hcloud.ErrorCodeConflict) || hcloud.IsError(err, hcloud.ErrorCodeLocked) {
512+
if hcloud.IsError(err, hcloud.ErrorCodeConflict, hcloud.ErrorCodeLocked) {
513513
klog.InfoS("retry due to conflict or lock",
514514
"op", op, "delay", fmt.Sprintf("%v", retryDelay), "err", fmt.Sprintf("%v", err))
515515

@@ -520,7 +520,7 @@ func (l *LoadBalancerOps) attachToNetwork(ctx context.Context, lb *hcloud.LoadBa
520520
return false, fmt.Errorf("%s: %w", op, err)
521521
}
522522

523-
if err := WatchAction(ctx, l.ActionClient, a); err != nil {
523+
if err := l.ActionClient.WaitFor(ctx, a); err != nil {
524524
return false, fmt.Errorf("%s: %w", op, err)
525525
}
526526

@@ -554,7 +554,7 @@ func (l *LoadBalancerOps) togglePublicInterface(ctx context.Context, lb *hcloud.
554554
return false, fmt.Errorf("%s: %w", op, err)
555555
}
556556

557-
if err := WatchAction(ctx, l.ActionClient, a); err != nil {
557+
if err := l.ActionClient.WaitFor(ctx, a); err != nil {
558558
return false, fmt.Errorf("%s: %w", op, err)
559559
}
560560
return true, nil
@@ -658,7 +658,7 @@ func (l *LoadBalancerOps) ReconcileHCLBTargets(
658658
if err != nil {
659659
return changed, fmt.Errorf("%s: target: %s: %w", op, nodeName, err)
660660
}
661-
if err := WatchAction(ctx, l.ActionClient, a); err != nil {
661+
if err := l.ActionClient.WaitFor(ctx, a); err != nil {
662662
return changed, fmt.Errorf("%s: target: %s: %w", op, nodeName, err)
663663
}
664664
changed = true
@@ -695,7 +695,7 @@ func (l *LoadBalancerOps) ReconcileHCLBTargets(
695695
}
696696
return changed, e
697697
}
698-
if err := WatchAction(ctx, l.ActionClient, a); err != nil {
698+
if err := l.ActionClient.WaitFor(ctx, a); err != nil {
699699
var e error
700700
if foundServer {
701701
e = fmt.Errorf("%s: target: %s: %w", op, nodeName, err)
@@ -738,7 +738,7 @@ func (l *LoadBalancerOps) ReconcileHCLBTargets(
738738
}
739739
return changed, fmt.Errorf("%s: target %s: %w", op, node.Name, err)
740740
}
741-
if err := WatchAction(ctx, l.ActionClient, a); err != nil {
741+
if err := l.ActionClient.WaitFor(ctx, a); err != nil {
742742
return changed, fmt.Errorf("%s: target %s: %w", op, node.Name, err)
743743
}
744744
changed = true
@@ -780,7 +780,7 @@ func (l *LoadBalancerOps) ReconcileHCLBTargets(
780780
}
781781
return changed, fmt.Errorf("%s: target %s: %w", op, node, err)
782782
}
783-
if err := WatchAction(ctx, l.ActionClient, a); err != nil {
783+
if err := l.ActionClient.WaitFor(ctx, a); err != nil {
784784
return changed, fmt.Errorf("%s: target %s: %w", op, node, err)
785785
}
786786
changed = true
@@ -870,7 +870,7 @@ func (l *LoadBalancerOps) ReconcileHCLBServices(
870870
}
871871
}
872872

873-
if err = WatchAction(ctx, l.ActionClient, action); err != nil {
873+
if err = l.ActionClient.WaitFor(ctx, action); err != nil {
874874
return changed, fmt.Errorf("%s: %w", op, err)
875875
}
876876
changed = true
@@ -883,7 +883,7 @@ func (l *LoadBalancerOps) ReconcileHCLBServices(
883883
if err != nil {
884884
return changed, fmt.Errorf("%s: port %d: %w", op, p, err)
885885
}
886-
err = WatchAction(ctx, l.ActionClient, a)
886+
err = l.ActionClient.WaitFor(ctx, a)
887887
if err != nil {
888888
return changed, fmt.Errorf("%s: port: %d: %w", op, p, err)
889889
}

0 commit comments

Comments
 (0)