@@ -57,13 +57,6 @@ func (s *API) WaitForCluster(req *WaitForClusterRequest) (*Cluster, error) {
5757 return cluster .(* Cluster ), nil
5858}
5959
60- // WaitForClusterPoolsRequest is used by WaitForClusterPools method.
61- type WaitForClusterPoolsRequest struct {
62- ClusterID string
63- Region scw.Region
64- Timeout * time.Duration
65- }
66-
6760// WaitForPoolRequest is used by WaitForPool method.
6861type WaitForPoolRequest struct {
6962 PoolID string
@@ -72,7 +65,7 @@ type WaitForPoolRequest struct {
7265}
7366
7467// WaitForPool waits for a pool to be ready
75- func (s * API ) WaitForPool (req * WaitForPoolRequest ) error {
68+ func (s * API ) WaitForPool (req * WaitForPoolRequest ) ( * Pool , error ) {
7669 terminalStatus := map [PoolStatus ]struct {}{
7770 PoolStatusReady : {},
7871 PoolStatusWarning : {},
@@ -83,7 +76,7 @@ func (s *API) WaitForPool(req *WaitForPoolRequest) error {
8376 timeout = * req .Timeout
8477 }
8578
86- _ , err := async .WaitSync (& async.WaitSyncConfig {
79+ pool , err := async .WaitSync (& async.WaitSyncConfig {
8780 Get : func () (interface {}, bool , error ) {
8881 res , err := s .GetPool (& GetPoolRequest {
8982 PoolID : req .PoolID ,
@@ -95,11 +88,11 @@ func (s *API) WaitForPool(req *WaitForPoolRequest) error {
9588 }
9689 _ , isTerminal := terminalStatus [res .Status ]
9790
98- return nil , isTerminal , nil
91+ return res , isTerminal , nil
9992 },
10093 Timeout : timeout ,
10194 IntervalStrategy : async .LinearIntervalStrategy (5 * time .Second ),
10295 })
10396
104- return err
97+ return pool .( * Pool ), err
10598}
0 commit comments