Skip to content

Commit

Permalink
tag snapshots at creation (#145)
Browse files Browse the repository at this point in the history
* tag snapshots at creation
  • Loading branch information
jcodybaker committed Apr 25, 2019
1 parent ed8c3e7 commit 07f200d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,16 @@ func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequ
}
}

snap, resp, err := d.storage.CreateSnapshot(ctx, &godo.SnapshotCreateRequest{
snapReq := &godo.SnapshotCreateRequest{
VolumeID: req.GetSourceVolumeId(),
Name: req.GetName(),
Description: createdByDO,
})
}
if d.doTag != "" {
snapReq.Tags = append(snapReq.Tags, d.doTag)
}

snap, resp, err := d.storage.CreateSnapshot(ctx, snapReq)
if err != nil {
if resp != nil && resp.StatusCode == http.StatusConflict {
// 409 is returned when we try to snapshot a volume with the same
Expand Down

0 comments on commit 07f200d

Please sign in to comment.