@@ -972,13 +972,14 @@ func (c Client) CreateVolume(ctx context.Context, request *VolumeCreateRequest)
972972
973973 Logc (ctx ).WithFields (logFields ).Info ("Volume create request issued." )
974974
975- if _ , pollErr := poller .Poll (sdkCtx ); pollErr != nil {
975+ waitCtx , waitCancel := context .WithTimeout (ctx , DefaultTimeout )
976+ defer waitCancel ()
977+ gcnvVol , pollErr := poller .Wait (waitCtx )
978+ if pollErr != nil {
979+ Logc (ctx ).WithFields (logFields ).WithError (pollErr ).Error ("Error waiting for volume create operation to complete." )
976980 return nil , pollErr
977981 }
978- // The volume doesn't exist yet, so forge the name & network IDs to enable conversion to a Volume struct
979- newVol .Name = c .createVolumeID (cPool .Location , request .Name )
980- newVol .Network = cPool .NetworkFullName
981- return c .newVolumeFromGCNVVolume (ctx , newVol )
982+ return c .newVolumeFromGCNVVolume (ctx , gcnvVol )
982983}
983984
984985// UpdateNASVolume updates NAS-specific attributes of a volume: labels, unix permissions, and snapshot directory access.
@@ -1107,7 +1108,10 @@ func (c Client) DeleteVolume(ctx context.Context, volume *Volume) error {
11071108
11081109 Logc (ctx ).WithFields (logFields ).Debug ("Volume delete request issued." )
11091110
1110- if pollErr := poller .Poll (sdkCtx ); pollErr != nil {
1111+ waitCtx , waitCancel := context .WithTimeout (ctx , DefaultTimeout )
1112+ defer waitCancel ()
1113+ if pollErr := poller .Wait (waitCtx ); pollErr != nil {
1114+ Logc (ctx ).WithFields (logFields ).WithError (pollErr ).Error ("Error waiting for volume delete operation to complete." )
11111115 return pollErr
11121116 }
11131117
0 commit comments