Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add default retry interval #1149

Merged
merged 3 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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