Skip to content

Commit 80ccc4d

Browse files
committed
add RetryInterval on all wait functions
1 parent 195f364 commit 80ccc4d

File tree

7 files changed

+17
-10
lines changed

7 files changed

+17
-10
lines changed

internal/namespaces/block/v1alpha1/custom_snapshot.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ func blockSnapshotCreateBuilder(c *core.Command) *core.Command {
8080
resp := respI.(*block.Snapshot)
8181

8282
return block.NewAPI(core.ExtractClient(ctx)).WaitForSnapshot(&block.WaitForSnapshotRequest{
83-
SnapshotID: resp.ID,
84-
Zone: resp.Zone,
83+
SnapshotID: resp.ID,
84+
Zone: resp.Zone,
85+
RetryInterval: core.DefaultRetryInterval,
8586
})
8687
}
8788

internal/namespaces/block/v1alpha1/custom_volume.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ func blockVolumeCreateBuilder(c *core.Command) *core.Command {
7979
resp := respI.(*block.Volume)
8080

8181
return block.NewAPI(core.ExtractClient(ctx)).WaitForVolume(&block.WaitForVolumeRequest{
82-
VolumeID: resp.ID,
83-
Zone: resp.Zone,
82+
VolumeID: resp.ID,
83+
Zone: resp.Zone,
84+
RetryInterval: core.DefaultRetryInterval,
8485
})
8586
}
8687

internal/namespaces/function/v1beta1/custom_deploy.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,9 @@ func DeployStepCreateNamespace(
166166
})
167167

168168
namespace, err = api.WaitForNamespace(&function.WaitForNamespaceRequest{
169-
NamespaceID: namespace.ID,
170-
Region: namespace.Region,
169+
NamespaceID: namespace.ID,
170+
Region: namespace.Region,
171+
RetryInterval: core.DefaultRetryInterval,
171172
})
172173
if err != nil {
173174
return nil, fmt.Errorf("could not fetch created namespace: %w", err)

internal/namespaces/instance/v1/custom_image.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ func imageDeleteBuilder(c *core.Command) *core.Command {
334334
SnapshotID: snapshot.ID,
335335
Zone: args.Zone,
336336
TerminalStatus: &terminalStatus,
337+
RetryInterval: core.DefaultRetryInterval,
337338
})
338339
if err != nil {
339340
return nil, err

internal/namespaces/instance/v1/custom_server_action.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ func serverTerminateCommand() *core.Command {
419419
VolumeID: volume.ID,
420420
Zone: volume.Zone,
421421
TerminalStatus: &terminalStatus,
422+
RetryInterval: core.DefaultRetryInterval,
422423
})
423424
if err != nil {
424425
return nil, fmt.Errorf("failed to wait for block volume %s: %w", volume.ID, err)

internal/namespaces/instance/v1/custom_server_create_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,9 @@ func Test_CreateServer(t *testing.T) {
454454

455455
api := blockSDK.NewAPI(ctx.Client)
456456
vol, err := api.WaitForVolume(&blockSDK.WaitForVolumeRequest{
457-
VolumeID: rootVolume.ID,
458-
Zone: rootVolume.Zone,
457+
VolumeID: rootVolume.ID,
458+
Zone: rootVolume.Zone,
459+
RetryInterval: core.DefaultRetryInterval,
459460
})
460461
require.NoError(t, err)
461462
assert.NotNil(t, vol.Specs)

internal/namespaces/rdb/v1/custom_endpoint.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ func endpointCreateBuilder(c *core.Command) *core.Command {
125125
args := argsI.(*rdbCreateEndpointRequestCustom)
126126

127127
instance, err := api.WaitForInstance(&rdb.WaitForInstanceRequest{
128-
InstanceID: args.InstanceID,
129-
Region: args.Region,
128+
InstanceID: args.InstanceID,
129+
Region: args.Region,
130+
RetryInterval: core.DefaultRetryInterval,
130131
}, scw.WithContext(ctx))
131132
if err != nil {
132133
return nil, err

0 commit comments

Comments
 (0)