Azure: fix bug preventing snapshot deletion

Signed-off-by: Steve Kriss <steve@heptio.com>
pull/378/head
Steve Kriss 2018-03-13 17:03:14 -07:00
parent 51c546786e
commit b2b16b3c85
1 changed files with 7 additions and 2 deletions

View File

@ -233,12 +233,17 @@ func (b *blockStore) CreateSnapshot(volumeID, volumeAZ string, tags map[string]s
}
func (b *blockStore) DeleteSnapshot(snapshotID string) error {
snapshotInfo, err := parseFullSnapshotName(snapshotID)
if err != nil {
return err
}
ctx, cancel := context.WithTimeout(context.Background(), b.apiTimeout)
defer cancel()
_, errChan := b.snaps.Delete(b.resourceGroup, snapshotID, ctx.Done())
_, errChan := b.snaps.Delete(snapshotInfo.resourceGroup, snapshotInfo.name, ctx.Done())
err := <-errChan
err = <-errChan
return errors.WithStack(err)
}