Skip to content

Commit

Permalink
Wait for relabel to finish after AWS CVS volume import
Browse files Browse the repository at this point in the history
  • Loading branch information
clintonk authored and Andrew Kerr committed Apr 27, 2019
1 parent 320e5d4 commit f8257f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions storage_drivers/aws/aws_cvs.go
Original file line number Diff line number Diff line change
Expand Up @@ -782,11 +782,13 @@ func (d *NFSStorageDriver) Import(volConfig *storage.VolumeConfig, originalName

// Update the volume labels if Trident will manage its lifecycle
if !notManaged {
_, err = d.API.RelabelVolume(volume, d.updateTelemetryLabels(volume))
if err != nil {
if _, err := d.API.RelabelVolume(volume, d.updateTelemetryLabels(volume)); err != nil {
log.WithField("originalName", originalName).Errorf("Could not import volume, relabel failed: %v", err)
return fmt.Errorf("could not import volume %s, relabel failed: %v", originalName, err)
}
if err := d.API.WaitForVolumeState(volume, api.StateAvailable, []string{api.StateError}); err != nil {
return fmt.Errorf("could not import volume %s: %v", originalName, err)
}
}

// The CVS creation token cannot be changed, so use it as the internal name
Expand Down

0 comments on commit f8257f9

Please sign in to comment.