@@ -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