@@ -26,9 +26,9 @@ type WaitForClusterRequest struct {
2626
2727// WaitForCluster waits for the cluster to be in a "terminal state" before returning.
2828func (s * API ) WaitForCluster (req * WaitForClusterRequest , opts ... scw.RequestOption ) (* Cluster , error ) {
29- timeout := * req . Timeout
30- if timeout == 0 {
31- timeout = waitForClusterDefaultTimeout
29+ timeout := waitForClusterDefaultTimeout
30+ if req . Timeout != nil {
31+ timeout = * req . Timeout
3232 }
3333 retryInterval := defaultRetryInterval
3434 if req .RetryInterval != nil {
@@ -75,9 +75,9 @@ type WaitForPoolRequest struct {
7575
7676// WaitForPool waits for a pool to be ready
7777func (s * API ) WaitForPool (req * WaitForPoolRequest , opts ... scw.RequestOption ) (* Pool , error ) {
78- timeout := * req . Timeout
79- if timeout == 0 {
80- timeout = waitForPoolDefaultTimeout
78+ timeout := waitForPoolDefaultTimeout
79+ if req . Timeout != nil {
80+ timeout = * req . Timeout
8181 }
8282 retryInterval := defaultRetryInterval
8383 if req .RetryInterval != nil {
@@ -170,11 +170,11 @@ type WaitForClusterPoolRequest struct {
170170 RetryInterval * time.Duration
171171}
172172
173- // WaitForClusterPool waits for the pool be associated with a cluster as a "terminal state" before returning.
173+ // WaitForClusterPool waits for the pool associated with a cluster to be in a "terminal state" before returning.
174174func (s * API ) WaitForClusterPool (req * WaitForClusterRequest , opts ... scw.RequestOption ) (* Cluster , error ) {
175- timeout := * req . Timeout
176- if timeout == 0 {
177- timeout = waitForClusterDefaultTimeout
175+ timeout := waitForClusterDefaultTimeout
176+ if req . Timeout != nil {
177+ timeout = * req . Timeout
178178 }
179179 retryInterval := defaultRetryInterval
180180 if req .RetryInterval != nil {
0 commit comments