Skip to content

Commit 49f1919

Browse files
remyleoneMonitob
authored andcommitted
fix: add default retry interval (scaleway#1149)
1 parent d39bdbd commit 49f1919

4 files changed

+30
-20
lines changed

scaleway/resource_container_namespace.go

+9-6
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ func resourceScalewayContainerNamespaceRead(ctx context.Context, d *schema.Resou
9292
}
9393

9494
ns, err := api.WaitForNamespace(&container.WaitForNamespaceRequest{
95-
Region: region,
96-
NamespaceID: id,
95+
Region: region,
96+
NamespaceID: id,
97+
RetryInterval: DefaultWaitRetryInterval,
9798
}, scw.WithContext(ctx))
9899

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

125126
ns, err := api.WaitForNamespace(&container.WaitForNamespaceRequest{
126-
Region: region,
127-
NamespaceID: id,
127+
Region: region,
128+
NamespaceID: id,
129+
RetryInterval: DefaultWaitRetryInterval,
128130
}, scw.WithContext(ctx))
129131
if err != nil {
130132
return diag.FromErr(err)
@@ -158,8 +160,9 @@ func resourceScalewayContainerNamespaceDelete(ctx context.Context, d *schema.Res
158160
}
159161

160162
_, err = api.WaitForNamespace(&container.WaitForNamespaceRequest{
161-
Region: region,
162-
NamespaceID: id,
163+
Region: region,
164+
NamespaceID: id,
165+
RetryInterval: DefaultWaitRetryInterval,
163166
}, scw.WithContext(ctx))
164167
if err != nil {
165168
return nil

scaleway/resource_function_namespace.go

+9-6
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ func resourceScalewayFunctionNamespaceRead(ctx context.Context, d *schema.Resour
9292
}
9393

9494
ns, err := api.WaitForNamespace(&function.WaitForNamespaceRequest{
95-
Region: region,
96-
NamespaceID: id,
95+
Region: region,
96+
NamespaceID: id,
97+
RetryInterval: DefaultWaitRetryInterval,
9798
}, scw.WithContext(ctx))
9899

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

125126
ns, err := api.WaitForNamespace(&function.WaitForNamespaceRequest{
126-
Region: region,
127-
NamespaceID: id,
127+
Region: region,
128+
NamespaceID: id,
129+
RetryInterval: DefaultWaitRetryInterval,
128130
}, scw.WithContext(ctx))
129131
if err != nil {
130132
if is404Error(err) {
@@ -161,8 +163,9 @@ func resourceScalewayFunctionNamespaceDelete(ctx context.Context, d *schema.Reso
161163
}
162164

163165
_, err = api.WaitForNamespace(&function.WaitForNamespaceRequest{
164-
Region: region,
165-
NamespaceID: id,
166+
Region: region,
167+
NamespaceID: id,
168+
RetryInterval: DefaultWaitRetryInterval,
166169
}, scw.WithContext(ctx))
167170
if err != nil {
168171
return nil

scaleway/resource_rdb_acl.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,9 @@ func resourceScalewayRdbACLUpdate(ctx context.Context, d *schema.ResourceData, m
134134

135135
if d.HasChange("acl_rules") {
136136
_ = rdb.WaitForInstanceRequest{
137-
InstanceID: instanceID,
138-
Region: region,
137+
InstanceID: instanceID,
138+
Region: region,
139+
RetryInterval: DefaultWaitRetryInterval,
139140
}
140141

141142
aclRules, err := rdbACLExpand(d.Get("acl_rules").(*schema.Set))

scaleway/resource_registry_namespace.go

+9-6
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ func resourceScalewayRegistryNamespaceRead(ctx context.Context, d *schema.Resour
8080
}
8181

8282
ns, err := api.WaitForNamespace(&registry.WaitForNamespaceRequest{
83-
Region: region,
84-
NamespaceID: id,
83+
Region: region,
84+
NamespaceID: id,
85+
RetryInterval: DefaultWaitRetryInterval,
8586
}, scw.WithContext(ctx))
8687

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

112113
_, err = api.WaitForNamespace(&registry.WaitForNamespaceRequest{
113-
Region: region,
114-
NamespaceID: id,
114+
Region: region,
115+
NamespaceID: id,
116+
RetryInterval: DefaultWaitRetryInterval,
115117
}, scw.WithContext(ctx))
116118

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

145147
_, err = api.WaitForNamespace(&registry.WaitForNamespaceRequest{
146-
Region: region,
147-
NamespaceID: id,
148+
Region: region,
149+
NamespaceID: id,
150+
RetryInterval: DefaultWaitRetryInterval,
148151
}, scw.WithContext(ctx))
149152

150153
if err != nil {

0 commit comments

Comments
 (0)