Skip to content

Commit

Permalink
refactor: pass *cobra.Command into ActionWaiter
Browse files Browse the repository at this point in the history
  • Loading branch information
phm07 committed Jan 2, 2024
1 parent af9dec4 commit 22c9f23
Show file tree
Hide file tree
Showing 112 changed files with 157 additions and 157 deletions.
2 changes: 1 addition & 1 deletion internal/cmd/base/set_rdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (rc *SetRdnsCmd) Run(ctx context.Context, client hcapi2.Client, cmd *cobra.
return err
}

if err := actionWaiter.ActionProgress(ctx, action); err != nil {
if err := actionWaiter.ActionProgress(cmd, ctx, action); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/certificate/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func createManaged(ctx context.Context, client hcapi2.Client, waiter state.Actio
if err != nil {
return nil, err
}
if err := waiter.ActionProgress(ctx, res.Action); err != nil {
if err := waiter.ActionProgress(cmd, ctx, res.Action); err != nil {
return nil, err
}
cmd.Printf("Certificate %d created\n", res.Certificate.ID)
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/certificate/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestCreateManaged(t *testing.T) {
Action: &hcloud.Action{ID: 321},
}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 321})
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 321})

out, _, err := fx.Run(cmd, []string{"--name", "test", "--type", "managed", "--domain", "example.com"})

Expand Down Expand Up @@ -97,7 +97,7 @@ func TestCreateManagedJSON(t *testing.T) {
Action: &hcloud.Action{ID: 321},
}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 321})
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 321})

jsonOut, out, err := fx.Run(cmd, []string{"-o=json", "--name", "test", "--type", "managed", "--domain", "example.com"})

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/add_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ var AddRuleCmd = base.Cmd{
if err != nil {
return err
}
if err := waiter.WaitForActions(ctx, actions); err != nil {
if err := waiter.WaitForActions(cmd, ctx, actions); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/add_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestAddRule(t *testing.T) {
}).
Return([]*hcloud.Action{{ID: 123}, {ID: 321}}, nil, nil)
fx.ActionWaiter.EXPECT().
WaitForActions(gomock.Any(), []*hcloud.Action{{ID: 123}, {ID: 321}}).
WaitForActions(gomock.Any(), gomock.Any(), []*hcloud.Action{{ID: 123}, {ID: 321}}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"--direction", "in", "--protocol", "tcp", "--source-ips", "0.0.0.0/0", "--port", "80", "--description", "http", "test"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/apply_to_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ var ApplyToResourceCmd = base.Cmd{
if err != nil {
return err
}
if err := waiter.WaitForActions(ctx, actions); err != nil {
if err := waiter.WaitForActions(cmd, ctx, actions); err != nil {
return err
}
cmd.Printf("Firewall %d applied\n", firewall.ID)
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/firewall/apply_to_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestApplyToServer(t *testing.T) {
}}).
Return([]*hcloud.Action{{ID: 123}, {ID: 321}}, nil, nil)
fx.ActionWaiter.EXPECT().
WaitForActions(gomock.Any(), []*hcloud.Action{{ID: 123}, {ID: 321}}).
WaitForActions(gomock.Any(), gomock.Any(), []*hcloud.Action{{ID: 123}, {ID: 321}}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"--type", "server", "--server", "my-server", "test"})
Expand Down Expand Up @@ -81,7 +81,7 @@ func TestApplyToLabelSelector(t *testing.T) {
}}).
Return([]*hcloud.Action{{ID: 123}, {ID: 321}}, nil, nil)
fx.ActionWaiter.EXPECT().
WaitForActions(gomock.Any(), []*hcloud.Action{{ID: 123}, {ID: 321}}).
WaitForActions(gomock.Any(), gomock.Any(), []*hcloud.Action{{ID: 123}, {ID: 321}}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"--type", "label_selector", "--label-selector", "my-label", "test"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ var CreateCmd = base.CreateCmd{
return nil, nil, err
}

if err := waiter.WaitForActions(ctx, result.Actions); err != nil {
if err := waiter.WaitForActions(cmd, ctx, result.Actions); err != nil {
return nil, nil, err
}

Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/firewall/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestCreate(t *testing.T) {
Actions: []*hcloud.Action{{ID: 321}},
}, nil, nil)
fx.ActionWaiter.EXPECT().
WaitForActions(gomock.Any(), []*hcloud.Action{{ID: 321}})
WaitForActions(gomock.Any(), gomock.Any(), []*hcloud.Action{{ID: 321}})

out, _, err := fx.Run(cmd, []string{"--name", "test"})

Expand Down Expand Up @@ -90,7 +90,7 @@ func TestCreateJSON(t *testing.T) {
Actions: []*hcloud.Action{{ID: 321}},
}, nil, nil)
fx.ActionWaiter.EXPECT().
WaitForActions(gomock.Any(), []*hcloud.Action{{ID: 321}})
WaitForActions(gomock.Any(), gomock.Any(), []*hcloud.Action{{ID: 321}})

jsonOut, out, err := fx.Run(cmd, []string{"-o=json", "--name", "test"})

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/delete_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ var DeleteRuleCmd = base.Cmd{
if err != nil {
return err
}
if err := waiter.WaitForActions(ctx, actions); err != nil {
if err := waiter.WaitForActions(cmd, ctx, actions); err != nil {
return err
}
cmd.Printf("Firewall Rules for Firewall %d updated\n", firewall.ID)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/delete_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestDeleteRule(t *testing.T) {
SetRules(gomock.Any(), firewall, hcloud.FirewallSetRulesOpts{Rules: nil}).
Return([]*hcloud.Action{{ID: 123}, {ID: 321}}, nil, nil)
fx.ActionWaiter.EXPECT().
WaitForActions(gomock.Any(), []*hcloud.Action{{ID: 123}, {ID: 321}}).
WaitForActions(gomock.Any(), gomock.Any(), []*hcloud.Action{{ID: 123}, {ID: 321}}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"--direction", "in", "--protocol", "tcp", "--source-ips", "0.0.0.0/0", "--port", "80", "--description", "http", "test"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/remove_from_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ var RemoveFromResourceCmd = base.Cmd{
if err != nil {
return err
}
if err := waiter.WaitForActions(ctx, actions); err != nil {
if err := waiter.WaitForActions(cmd, ctx, actions); err != nil {
return err
}
cmd.Printf("Firewall %d applied\n", firewall.ID)
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/firewall/remove_from_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestRemoveFromServer(t *testing.T) {
}}).
Return([]*hcloud.Action{{ID: 123}, {ID: 321}}, nil, nil)
fx.ActionWaiter.EXPECT().
WaitForActions(gomock.Any(), []*hcloud.Action{{ID: 123}, {ID: 321}}).
WaitForActions(gomock.Any(), gomock.Any(), []*hcloud.Action{{ID: 123}, {ID: 321}}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"--type", "server", "--server", "my-server", "test"})
Expand Down Expand Up @@ -81,7 +81,7 @@ func TestRemoveFromLabelSelector(t *testing.T) {
}}).
Return([]*hcloud.Action{{ID: 123}, {ID: 321}}, nil, nil)
fx.ActionWaiter.EXPECT().
WaitForActions(gomock.Any(), []*hcloud.Action{{ID: 123}, {ID: 321}}).
WaitForActions(gomock.Any(), gomock.Any(), []*hcloud.Action{{ID: 123}, {ID: 321}}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"--type", "label_selector", "--label-selector", "my-label", "test"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/replace_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ var ReplaceRulesCmd = base.Cmd{
if err != nil {
return err
}
if err := waiter.WaitForActions(ctx, actions); err != nil {
if err := waiter.WaitForActions(cmd, ctx, actions); err != nil {
return err
}
cmd.Printf("Firewall Rules for Firewall %d updated\n", firewall.ID)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/replace_rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestReplaceRules(t *testing.T) {
}).
Return([]*hcloud.Action{{ID: 123}, {ID: 321}}, nil, nil)
fx.ActionWaiter.EXPECT().
WaitForActions(gomock.Any(), []*hcloud.Action{{ID: 123}, {ID: 321}}).
WaitForActions(gomock.Any(), gomock.Any(), []*hcloud.Action{{ID: 123}, {ID: 321}}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"--rules-file", "testdata/rules.json", "test"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/floatingip/assign.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var AssignCmd = base.Cmd{
return err
}

if err := waiter.ActionProgress(ctx, action); err != nil {
if err := waiter.ActionProgress(cmd, ctx, action); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/floatingip/assign_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestAssign(t *testing.T) {
Assign(gomock.Any(), &hcloud.FloatingIP{ID: 123}, &hcloud.Server{ID: 456}).
Return(&hcloud.Action{ID: 123}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 123}).
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"my-ip", "my-server"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/floatingip/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ var CreateCmd = base.CreateCmd{
}

if result.Action != nil {
if err := waiter.ActionProgress(ctx, result.Action); err != nil {
if err := waiter.ActionProgress(cmd, ctx, result.Action); err != nil {
return nil, nil, err
}
}
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/floatingip/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ func TestCreateProtection(t *testing.T) {
ID: 321,
},
}, nil, nil)
fx.ActionWaiter.EXPECT().ActionProgress(gomock.Any(), &hcloud.Action{ID: 321}).Return(nil)
fx.ActionWaiter.EXPECT().ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 321}).Return(nil)

fx.Client.FloatingIPClient.EXPECT().
ChangeProtection(gomock.Any(), floatingIp, hcloud.FloatingIPChangeProtectionOpts{
Delete: hcloud.Ptr(true),
}).
Return(&hcloud.Action{ID: 333}, nil, nil)
fx.ActionWaiter.EXPECT().ActionProgress(gomock.Any(), &hcloud.Action{ID: 333}).Return(nil)
fx.ActionWaiter.EXPECT().ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 333}).Return(nil)

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

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/floatingip/disable_protection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestDisableProtection(t *testing.T) {
}).
Return(&hcloud.Action{ID: 123}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 123}).
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"test", "delete"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/floatingip/enable_protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func changeProtection(ctx context.Context, client hcapi2.Client, waiter state.Ac
return err
}

if err := waiter.ActionProgress(ctx, action); err != nil {
if err := waiter.ActionProgress(cmd, ctx, action); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/floatingip/enable_protection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestEnableProtection(t *testing.T) {
}).
Return(&hcloud.Action{ID: 123}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 123}).
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"test", "delete"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/floatingip/set_rdns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestSetRDNS(t *testing.T) {
ChangeDNSPtr(gomock.Any(), floatingIP, floatingIP.IP, hcloud.Ptr("example.com")).
Return(&hcloud.Action{ID: 123}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 123}).
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"--hostname", "example.com", "test"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/floatingip/unassign.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var UnassignCmd = base.Cmd{
return err
}

if err := waiter.ActionProgress(ctx, action); err != nil {
if err := waiter.ActionProgress(cmd, ctx, action); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/floatingip/unassign_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestUnassign(t *testing.T) {
Unassign(gomock.Any(), &hcloud.FloatingIP{ID: 123}).
Return(&hcloud.Action{ID: 123}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 123}).
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"my-ip"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/image/disable_protection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestDisableProtection(t *testing.T) {
}).
Return(&hcloud.Action{ID: 123}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 123}).
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"123", "delete"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/image/enable_protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func changeProtection(ctx context.Context, client hcapi2.Client, waiter state.Ac
return err
}

if err := waiter.ActionProgress(ctx, action); err != nil {
if err := waiter.ActionProgress(cmd, ctx, action); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/image/enable_protection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestEnableProtection(t *testing.T) {
}).
Return(&hcloud.Action{ID: 123}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 123}).
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"123", "delete"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/add_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ var AddServiceCmd = base.Cmd{
if err != nil {
return err
}
if err := waiter.ActionProgress(ctx, action); err != nil {
if err := waiter.ActionProgress(cmd, ctx, action); err != nil {
return err
}
cmd.Printf("Service was added to Load Balancer %d\n", loadBalancer.ID)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/add_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestAddService(t *testing.T) {
}).
Return(&hcloud.Action{ID: 123}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 123}).
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"123", "--protocol", "http", "--listen-port", "80", "--destination-port", "8080"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/add_target.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ var AddTargetCmd = base.Cmd{
return fmt.Errorf("specify one of --server, --label-selector, or --ip")
}

if err := waiter.ActionProgress(ctx, action); err != nil {
if err := waiter.ActionProgress(cmd, ctx, action); err != nil {
return err
}
cmd.Printf("Target added to Load Balancer %d\n", loadBalancer.ID)
Expand Down
6 changes: 3 additions & 3 deletions internal/cmd/loadbalancer/add_target_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestAddTargetServer(t *testing.T) {
}).
Return(&hcloud.Action{ID: 123}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 123}).
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"123", "--server", "my-server"})
Expand Down Expand Up @@ -68,7 +68,7 @@ func TestAddTargetLabelSelector(t *testing.T) {
}).
Return(&hcloud.Action{ID: 123}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 123}).
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"123", "--label-selector", "my-label"})
Expand Down Expand Up @@ -99,7 +99,7 @@ func TestAddTargetIP(t *testing.T) {
}).
Return(&hcloud.Action{ID: 123}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 123}).
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"123", "--ip", "192.168.2.1"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/attach_to_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var AttachToNetworkCmd = base.Cmd{
return err
}

if err := waiter.ActionProgress(ctx, action); err != nil {
if err := waiter.ActionProgress(cmd, ctx, action); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/attach_to_network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestAttachToNetwork(t *testing.T) {
}).
Return(&hcloud.Action{ID: 123}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 123}).
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"123", "--network", "my-network"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/change_algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var ChangeAlgorithmCmd = base.Cmd{
if err != nil {
return err
}
if err := waiter.ActionProgress(ctx, action); err != nil {
if err := waiter.ActionProgress(cmd, ctx, action); err != nil {
return err
}
cmd.Printf("Algorithm for Load Balancer %d was changed\n", loadBalancer.ID)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/change_algorithm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestChangeAlgorithm(t *testing.T) {
}).
Return(&hcloud.Action{ID: 123}, nil, nil)
fx.ActionWaiter.EXPECT().
ActionProgress(gomock.Any(), &hcloud.Action{ID: 123}).
ActionProgress(gomock.Any(), gomock.Any(), &hcloud.Action{ID: 123}).
Return(nil)

out, _, err := fx.Run(cmd, []string{"123", "--algorithm-type", "least_connections"})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/change_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var ChangeTypeCmd = base.Cmd{
return err
}

if err := waiter.ActionProgress(ctx, action); err != nil {
if err := waiter.ActionProgress(cmd, ctx, action); err != nil {
return err
}

Expand Down
Loading

0 comments on commit 22c9f23

Please sign in to comment.