Skip to content

Commit 9e30f3f

Browse files
authored
feat: new action waiting progress (#749)
This replaces the 2 previous actions progress display with a single consistent one, that leverage the new `hcloud.ActionWaiter` functions. ![Screenshot from 2024-05-08 16-03-01](https://github.com/hetznercloud/cli/assets/19195485/4c106811-9aac-4038-a6f7-f8895c2b122d) ![Screenshot from 2024-05-08 16-03-04](https://github.com/hetznercloud/cli/assets/19195485/2909b6e7-c396-48c8-9270-2fbcf37d4d1d) The progress features have been extracted in a dedicated `ui` package to split the actions waiting and the progress concerns.
1 parent 2cd08b2 commit 9e30f3f

File tree

151 files changed

+773
-334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+773
-334
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ require (
66
github.com/boumenot/gocover-cobertura v1.2.0
77
github.com/cheggaaa/pb/v3 v3.1.5
88
github.com/dustin/go-humanize v1.0.1
9+
github.com/fatih/color v1.16.0
910
github.com/fatih/structs v1.1.0
1011
github.com/goccy/go-yaml v1.11.3
1112
github.com/golang/mock v1.6.0
@@ -24,7 +25,6 @@ require (
2425
github.com/beorn7/perks v1.0.1 // indirect
2526
github.com/cespare/xxhash/v2 v2.2.0 // indirect
2627
github.com/davecgh/go-spew v1.1.1 // indirect
27-
github.com/fatih/color v1.16.0 // indirect
2828
github.com/inconshreveable/mousetrap v1.1.0 // indirect
2929
github.com/mattn/go-colorable v0.1.13 // indirect
3030
github.com/mattn/go-isatty v0.0.20 // indirect

internal/cmd/base/set_rdns.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func (rc *SetRdnsCmd) Run(s state.State, cmd *cobra.Command, args []string) erro
7373
return err
7474
}
7575

76-
if err := s.ActionProgress(cmd, s, action); err != nil {
76+
if err := s.WaitForActions(cmd, s, action); err != nil {
7777
return err
7878
}
7979

internal/cmd/certificate/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func createManaged(s state.State, cmd *cobra.Command) (*hcloud.Certificate, erro
129129
if err != nil {
130130
return nil, err
131131
}
132-
if err := s.ActionProgress(cmd, s, res.Action); err != nil {
132+
if err := s.WaitForActions(cmd, s, res.Action); err != nil {
133133
return nil, err
134134
}
135135
defer cmd.Printf("Certificate %d created\n", res.Certificate.ID)

internal/cmd/certificate/create_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func TestCreateManaged(t *testing.T) {
4242
Action: &hcloud.Action{ID: 321},
4343
}, nil, nil)
4444
fx.ActionWaiter.EXPECT().
45-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 321})
45+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 321})
4646
fx.Client.CertificateClient.EXPECT().
4747
GetByID(gomock.Any(), int64(123)).
4848
Return(&hcloud.Certificate{
@@ -96,7 +96,7 @@ func TestCreateManagedJSON(t *testing.T) {
9696
Action: &hcloud.Action{ID: 321},
9797
}, nil, nil)
9898
fx.ActionWaiter.EXPECT().
99-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 321})
99+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 321})
100100
fx.Client.CertificateClient.EXPECT().
101101
GetByID(gomock.Any(), int64(123)).
102102
Return(&hcloud.Certificate{

internal/cmd/context/create.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/hetznercloud/cli/internal/cmd/util"
1515
"github.com/hetznercloud/cli/internal/state"
1616
"github.com/hetznercloud/cli/internal/state/config"
17+
"github.com/hetznercloud/cli/internal/ui"
1718
)
1819

1920
func newCreateCommand(s state.State) *cobra.Command {
@@ -30,7 +31,7 @@ func newCreateCommand(s state.State) *cobra.Command {
3031

3132
func runCreate(s state.State, cmd *cobra.Command, args []string) error {
3233
cfg := s.Config()
33-
if !state.StdoutIsTerminal() {
34+
if !ui.StdoutIsTerminal() {
3435
return errors.New("context create is an interactive command")
3536
}
3637

internal/cmd/firewall/add_rule.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ var AddRuleCmd = base.Cmd{
110110
if err != nil {
111111
return err
112112
}
113-
if err := s.WaitForActions(cmd, s, actions); err != nil {
113+
if err := s.WaitForActions(cmd, s, actions...); err != nil {
114114
return err
115115
}
116116

internal/cmd/firewall/apply_to_resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ var ApplyToResourceCmd = base.Cmd{
8181
if err != nil {
8282
return err
8383
}
84-
if err := s.WaitForActions(cmd, s, actions); err != nil {
84+
if err := s.WaitForActions(cmd, s, actions...); err != nil {
8585
return err
8686
}
8787
cmd.Printf("Firewall %d applied\n", firewall.ID)

internal/cmd/firewall/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var CreateCmd = base.CreateCmd{
8282
return nil, nil, err
8383
}
8484

85-
if err := s.WaitForActions(cmd, s, result.Actions); err != nil {
85+
if err := s.WaitForActions(cmd, s, result.Actions...); err != nil {
8686
return nil, nil, err
8787
}
8888

internal/cmd/firewall/delete_rule.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ var DeleteRuleCmd = base.Cmd{
118118
if err != nil {
119119
return err
120120
}
121-
if err := s.WaitForActions(cmd, s, actions); err != nil {
121+
if err := s.WaitForActions(cmd, s, actions...); err != nil {
122122
return err
123123
}
124124
cmd.Printf("Firewall Rules for Firewall %d updated\n", firewall.ID)

internal/cmd/firewall/remove_from_resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ var RemoveFromResourceCmd = base.Cmd{
8080
if err != nil {
8181
return err
8282
}
83-
if err := s.WaitForActions(cmd, s, actions); err != nil {
83+
if err := s.WaitForActions(cmd, s, actions...); err != nil {
8484
return err
8585
}
8686
cmd.Printf("Firewall %d applied\n", firewall.ID)

internal/cmd/firewall/replace_rules.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ var ReplaceRulesCmd = base.Cmd{
9393
if err != nil {
9494
return err
9595
}
96-
if err := s.WaitForActions(cmd, s, actions); err != nil {
96+
if err := s.WaitForActions(cmd, s, actions...); err != nil {
9797
return err
9898
}
9999
cmd.Printf("Firewall Rules for Firewall %d updated\n", firewall.ID)

internal/cmd/floatingip/assign.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var AssignCmd = base.Cmd{
4848
return err
4949
}
5050

51-
if err := s.ActionProgress(cmd, s, action); err != nil {
51+
if err := s.WaitForActions(cmd, s, action); err != nil {
5252
return err
5353
}
5454

internal/cmd/floatingip/assign_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func TestAssign(t *testing.T) {
2828
Assign(gomock.Any(), &hcloud.FloatingIP{ID: 123}, &hcloud.Server{ID: 456}).
2929
Return(&hcloud.Action{ID: 123}, nil, nil)
3030
fx.ActionWaiter.EXPECT().
31-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
31+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
3232
Return(nil)
3333

3434
out, errOut, err := fx.Run(cmd, []string{"my-ip", "my-server"})

internal/cmd/floatingip/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ var CreateCmd = base.CreateCmd{
9494
}
9595

9696
if result.Action != nil {
97-
if err := s.ActionProgress(cmd, s, result.Action); err != nil {
97+
if err := s.WaitForActions(cmd, s, result.Action); err != nil {
9898
return nil, nil, err
9999
}
100100
}

internal/cmd/floatingip/create_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ func TestCreateProtection(t *testing.T) {
116116
ID: 321,
117117
},
118118
}, nil, nil)
119-
fx.ActionWaiter.EXPECT().ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 321}).Return(nil)
119+
fx.ActionWaiter.EXPECT().WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 321}).Return(nil)
120120

121121
fx.Client.FloatingIPClient.EXPECT().
122122
ChangeProtection(gomock.Any(), floatingIp, hcloud.FloatingIPChangeProtectionOpts{
123123
Delete: hcloud.Ptr(true),
124124
}).
125125
Return(&hcloud.Action{ID: 333}, nil, nil)
126-
fx.ActionWaiter.EXPECT().ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 333}).Return(nil)
126+
fx.ActionWaiter.EXPECT().WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 333}).Return(nil)
127127

128128
out, errOut, err := fx.Run(cmd, []string{"--name", "myFloatingIP", "--type", "ipv4", "--home-location", "fsn1", "--enable-protection", "delete"})
129129

internal/cmd/floatingip/disable_protection_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestDisableProtection(t *testing.T) {
2727
}).
2828
Return(&hcloud.Action{ID: 123}, nil, nil)
2929
fx.ActionWaiter.EXPECT().
30-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
30+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
3131
Return(nil)
3232

3333
out, errOut, err := fx.Run(cmd, []string{"test", "delete"})

internal/cmd/floatingip/enable_protection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func changeProtection(s state.State, cmd *cobra.Command,
4545
return err
4646
}
4747

48-
if err := s.ActionProgress(cmd, s, action); err != nil {
48+
if err := s.WaitForActions(cmd, s, action); err != nil {
4949
return err
5050
}
5151

internal/cmd/floatingip/enable_protection_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestEnableProtection(t *testing.T) {
2727
}).
2828
Return(&hcloud.Action{ID: 123}, nil, nil)
2929
fx.ActionWaiter.EXPECT().
30-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
30+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
3131
Return(nil)
3232

3333
out, errOut, err := fx.Run(cmd, []string{"test", "delete"})

internal/cmd/floatingip/set_rdns_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func TestSetRDNS(t *testing.T) {
3131
ChangeDNSPtr(gomock.Any(), floatingIP, floatingIP.IP, hcloud.Ptr("example.com")).
3232
Return(&hcloud.Action{ID: 123}, nil, nil)
3333
fx.ActionWaiter.EXPECT().
34-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
34+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
3535
Return(nil)
3636

3737
out, errOut, err := fx.Run(cmd, []string{"--hostname", "example.com", "test"})

internal/cmd/floatingip/unassign.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var UnassignCmd = base.Cmd{
3636
return err
3737
}
3838

39-
if err := s.ActionProgress(cmd, s, action); err != nil {
39+
if err := s.WaitForActions(cmd, s, action); err != nil {
4040
return err
4141
}
4242

internal/cmd/floatingip/unassign_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func TestUnassign(t *testing.T) {
2525
Unassign(gomock.Any(), &hcloud.FloatingIP{ID: 123}).
2626
Return(&hcloud.Action{ID: 123}, nil, nil)
2727
fx.ActionWaiter.EXPECT().
28-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
28+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
2929
Return(nil)
3030

3131
out, errOut, err := fx.Run(cmd, []string{"my-ip"})

internal/cmd/image/disable_protection_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestDisableProtection(t *testing.T) {
2424
}).
2525
Return(&hcloud.Action{ID: 123}, nil, nil)
2626
fx.ActionWaiter.EXPECT().
27-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
27+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
2828
Return(nil)
2929

3030
out, errOut, err := fx.Run(cmd, []string{"123", "delete"})

internal/cmd/image/enable_protection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func changeProtection(s state.State, cmd *cobra.Command,
4747
return err
4848
}
4949

50-
if err := s.ActionProgress(cmd, s, action); err != nil {
50+
if err := s.WaitForActions(cmd, s, action); err != nil {
5151
return err
5252
}
5353

internal/cmd/image/enable_protection_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestEnableProtection(t *testing.T) {
2424
}).
2525
Return(&hcloud.Action{ID: 123}, nil, nil)
2626
fx.ActionWaiter.EXPECT().
27-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
27+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
2828
Return(nil)
2929

3030
out, errOut, err := fx.Run(cmd, []string{"123", "delete"})

internal/cmd/loadbalancer/add_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ var AddServiceCmd = base.Cmd{
208208
if err != nil {
209209
return err
210210
}
211-
if err := s.ActionProgress(cmd, s, action); err != nil {
211+
if err := s.WaitForActions(cmd, s, action); err != nil {
212212
return err
213213
}
214214
cmd.Printf("Service was added to Load Balancer %d\n", loadBalancer.ID)

internal/cmd/loadbalancer/add_service_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func TestAddService(t *testing.T) {
3535
}).
3636
Return(&hcloud.Action{ID: 123}, nil, nil)
3737
fx.ActionWaiter.EXPECT().
38-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
38+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
3939
Return(nil)
4040

4141
out, errOut, err := fx.Run(cmd, []string{"123", "--protocol", "http", "--listen-port", "80", "--destination-port", "8080"})
@@ -87,7 +87,7 @@ func TestAddServiceWithHealthCheck(t *testing.T) {
8787
}).
8888
Return(&hcloud.Action{ID: 123}, nil, nil)
8989
fx.ActionWaiter.EXPECT().
90-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
90+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
9191
Return(nil)
9292

9393
out, errOut, err := fx.Run(cmd, []string{

internal/cmd/loadbalancer/add_target.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ var AddTargetCmd = base.Cmd{
9595
return fmt.Errorf("specify one of --server, --label-selector, or --ip")
9696
}
9797

98-
if err := s.ActionProgress(cmd, s, action); err != nil {
98+
if err := s.WaitForActions(cmd, s, action); err != nil {
9999
return err
100100
}
101101
cmd.Printf("Target added to Load Balancer %d\n", loadBalancer.ID)

internal/cmd/loadbalancer/add_target_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func TestAddTargetServer(t *testing.T) {
3232
}).
3333
Return(&hcloud.Action{ID: 123}, nil, nil)
3434
fx.ActionWaiter.EXPECT().
35-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
35+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
3636
Return(nil)
3737

3838
out, errOut, err := fx.Run(cmd, []string{"123", "--server", "my-server"})
@@ -61,7 +61,7 @@ func TestAddTargetLabelSelector(t *testing.T) {
6161
}).
6262
Return(&hcloud.Action{ID: 123}, nil, nil)
6363
fx.ActionWaiter.EXPECT().
64-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
64+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
6565
Return(nil)
6666

6767
out, errOut, err := fx.Run(cmd, []string{"123", "--label-selector", "my-label"})
@@ -89,7 +89,7 @@ func TestAddTargetIP(t *testing.T) {
8989
}).
9090
Return(&hcloud.Action{ID: 123}, nil, nil)
9191
fx.ActionWaiter.EXPECT().
92-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
92+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
9393
Return(nil)
9494

9595
out, errOut, err := fx.Run(cmd, []string{"123", "--ip", "192.168.2.1"})

internal/cmd/loadbalancer/attach_to_network.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var AttachToNetworkCmd = base.Cmd{
6161
return err
6262
}
6363

64-
if err := s.ActionProgress(cmd, s, action); err != nil {
64+
if err := s.WaitForActions(cmd, s, action); err != nil {
6565
return err
6666
}
6767

internal/cmd/loadbalancer/attach_to_network_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestAttachToNetwork(t *testing.T) {
3030
}).
3131
Return(&hcloud.Action{ID: 123}, nil, nil)
3232
fx.ActionWaiter.EXPECT().
33-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
33+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
3434
Return(nil)
3535

3636
out, errOut, err := fx.Run(cmd, []string{"123", "--network", "my-network"})

internal/cmd/loadbalancer/change_algorithm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var ChangeAlgorithmCmd = base.Cmd{
4646
if err != nil {
4747
return err
4848
}
49-
if err := s.ActionProgress(cmd, s, action); err != nil {
49+
if err := s.WaitForActions(cmd, s, action); err != nil {
5050
return err
5151
}
5252
cmd.Printf("Algorithm for Load Balancer %d was changed\n", loadBalancer.ID)

internal/cmd/loadbalancer/change_algorithm_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestChangeAlgorithm(t *testing.T) {
2727
}).
2828
Return(&hcloud.Action{ID: 123}, nil, nil)
2929
fx.ActionWaiter.EXPECT().
30-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
30+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
3131
Return(nil)
3232

3333
out, errOut, err := fx.Run(cmd, []string{"123", "--algorithm-type", "least_connections"})

internal/cmd/loadbalancer/change_type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ var ChangeTypeCmd = base.Cmd{
5252
return err
5353
}
5454

55-
if err := s.ActionProgress(cmd, s, action); err != nil {
55+
if err := s.WaitForActions(cmd, s, action); err != nil {
5656
return err
5757
}
5858

internal/cmd/loadbalancer/change_type_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func TestChangeType(t *testing.T) {
3232
}).
3333
Return(&hcloud.Action{ID: 123}, nil, nil)
3434
fx.ActionWaiter.EXPECT().
35-
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
35+
WaitForActions(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
3636
Return(nil)
3737

3838
out, errOut, err := fx.Run(cmd, []string{"123", "lb21"})

internal/cmd/loadbalancer/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ var CreateCmd = base.CreateCmd{
8080
return nil, nil, err
8181
}
8282

83-
if err := s.ActionProgress(cmd, s, result.Action); err != nil {
83+
if err := s.WaitForActions(cmd, s, result.Action); err != nil {
8484
return nil, nil, err
8585
}
8686
loadBalancer, _, err := s.Client().LoadBalancer().GetByID(s, result.LoadBalancer.ID)

0 commit comments

Comments
 (0)