Skip to content

Commit

Permalink
Fix the bug where ListSnapshot failing to query deleted fs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakan Memisoglu committed Aug 13, 2019
1 parent 4752482 commit 45d3bbb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 3 additions & 4 deletions pkg/blockstorage/awsefs/awsefs.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,9 @@ func (e *efs) snapshotsFromRecoveryPoints(ctx context.Context, rps []*backup.Rec
if err != nil {
return nil, errors.Wrap(err, "Failed to get volume ID from recovery point ARN")
}
vol, err := e.VolumeGet(ctx, volID, "")
if err != nil {
return nil, errors.Wrap(err, "Failed to get EFS volume")
}
// VolumeGet might return error since originating filesystem might have
// been deleted.
vol, _ := e.VolumeGet(ctx, volID, "")
snap, err := snapshotFromRecoveryPointByVault(rp, vol, tags, e.region)
if err != nil {
return nil, errors.Wrap(err, "Failed to get snapshot from the vault")
Expand Down
7 changes: 4 additions & 3 deletions pkg/blockstorage/awsefs/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ func snapshotFromRecoveryPointByVault(rp *backup.RecoveryPointByBackupVault, vol
if rp.RecoveryPointArn == nil {
return nil, errors.New("Recovery point has no RecoveryPointArn")
}
if volume == nil {
return nil, errors.New("Nil volume as argument")
encrypted := false
if volume != nil {
encrypted = volume.Encrypted
}
return &blockstorage.Snapshot{
ID: *rp.RecoveryPointArn,
Expand All @@ -100,7 +101,7 @@ func snapshotFromRecoveryPointByVault(rp *backup.RecoveryPointByBackupVault, vol
Region: region,
Type: blockstorage.TypeEFS,
Volume: volume,
Encrypted: volume.Encrypted,
Encrypted: encrypted,
Tags: blockstorage.MapToKeyValue(tags),
}, nil
}
Expand Down

0 comments on commit 45d3bbb

Please sign in to comment.