Skip to content

Commit

Permalink
fix: add default retry interval (scaleway#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone authored and Monitob committed Mar 22, 2022
1 parent d39bdbd commit 49f1919
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 20 deletions.
15 changes: 9 additions & 6 deletions scaleway/resource_container_namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ func resourceScalewayContainerNamespaceRead(ctx context.Context, d *schema.Resou
}

ns, err := api.WaitForNamespace(&container.WaitForNamespaceRequest{
Region: region,
NamespaceID: id,
Region: region,
NamespaceID: id,
RetryInterval: DefaultWaitRetryInterval,
}, scw.WithContext(ctx))

if err != nil {
Expand Down Expand Up @@ -123,8 +124,9 @@ func resourceScalewayContainerNamespaceUpdate(ctx context.Context, d *schema.Res
}

ns, err := api.WaitForNamespace(&container.WaitForNamespaceRequest{
Region: region,
NamespaceID: id,
Region: region,
NamespaceID: id,
RetryInterval: DefaultWaitRetryInterval,
}, scw.WithContext(ctx))
if err != nil {
return diag.FromErr(err)
Expand Down Expand Up @@ -158,8 +160,9 @@ func resourceScalewayContainerNamespaceDelete(ctx context.Context, d *schema.Res
}

_, err = api.WaitForNamespace(&container.WaitForNamespaceRequest{
Region: region,
NamespaceID: id,
Region: region,
NamespaceID: id,
RetryInterval: DefaultWaitRetryInterval,
}, scw.WithContext(ctx))
if err != nil {
return nil
Expand Down
15 changes: 9 additions & 6 deletions scaleway/resource_function_namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ func resourceScalewayFunctionNamespaceRead(ctx context.Context, d *schema.Resour
}

ns, err := api.WaitForNamespace(&function.WaitForNamespaceRequest{
Region: region,
NamespaceID: id,
Region: region,
NamespaceID: id,
RetryInterval: DefaultWaitRetryInterval,
}, scw.WithContext(ctx))

if err != nil {
Expand Down Expand Up @@ -123,8 +124,9 @@ func resourceScalewayFunctionNamespaceUpdate(ctx context.Context, d *schema.Reso
}

ns, err := api.WaitForNamespace(&function.WaitForNamespaceRequest{
Region: region,
NamespaceID: id,
Region: region,
NamespaceID: id,
RetryInterval: DefaultWaitRetryInterval,
}, scw.WithContext(ctx))
if err != nil {
if is404Error(err) {
Expand Down Expand Up @@ -161,8 +163,9 @@ func resourceScalewayFunctionNamespaceDelete(ctx context.Context, d *schema.Reso
}

_, err = api.WaitForNamespace(&function.WaitForNamespaceRequest{
Region: region,
NamespaceID: id,
Region: region,
NamespaceID: id,
RetryInterval: DefaultWaitRetryInterval,
}, scw.WithContext(ctx))
if err != nil {
return nil
Expand Down
5 changes: 3 additions & 2 deletions scaleway/resource_rdb_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ func resourceScalewayRdbACLUpdate(ctx context.Context, d *schema.ResourceData, m

if d.HasChange("acl_rules") {
_ = rdb.WaitForInstanceRequest{
InstanceID: instanceID,
Region: region,
InstanceID: instanceID,
Region: region,
RetryInterval: DefaultWaitRetryInterval,
}

aclRules, err := rdbACLExpand(d.Get("acl_rules").(*schema.Set))
Expand Down
15 changes: 9 additions & 6 deletions scaleway/resource_registry_namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ func resourceScalewayRegistryNamespaceRead(ctx context.Context, d *schema.Resour
}

ns, err := api.WaitForNamespace(&registry.WaitForNamespaceRequest{
Region: region,
NamespaceID: id,
Region: region,
NamespaceID: id,
RetryInterval: DefaultWaitRetryInterval,
}, scw.WithContext(ctx))

if err != nil {
Expand Down Expand Up @@ -110,8 +111,9 @@ func resourceScalewayRegistryNamespaceUpdate(ctx context.Context, d *schema.Reso
}

_, err = api.WaitForNamespace(&registry.WaitForNamespaceRequest{
Region: region,
NamespaceID: id,
Region: region,
NamespaceID: id,
RetryInterval: DefaultWaitRetryInterval,
}, scw.WithContext(ctx))

if err != nil {
Expand Down Expand Up @@ -143,8 +145,9 @@ func resourceScalewayRegistryNamespaceDelete(ctx context.Context, d *schema.Reso
}

_, err = api.WaitForNamespace(&registry.WaitForNamespaceRequest{
Region: region,
NamespaceID: id,
Region: region,
NamespaceID: id,
RetryInterval: DefaultWaitRetryInterval,
}, scw.WithContext(ctx))

if err != nil {
Expand Down

0 comments on commit 49f1919

Please sign in to comment.