diff --git a/README.md b/README.md index 99f0bfb..5e68e0a 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ These permissions are required by Velero to manage snapshot resources in the GCP compute.snapshots.create compute.snapshots.useReadOnly compute.snapshots.delete + compute.snapshots.setLabels compute.zones.get storage.objects.create storage.objects.delete diff --git a/velero-plugin-for-gcp/volume_snapshotter.go b/velero-plugin-for-gcp/volume_snapshotter.go index 974259e..c7c03a0 100644 --- a/velero-plugin-for-gcp/volume_snapshotter.go +++ b/velero-plugin-for-gcp/volume_snapshotter.go @@ -210,6 +210,7 @@ func (b *VolumeSnapshotter) CreateVolumeFromSnapshot(snapshotID, volumeType, vol SourceSnapshot: res.SelfLink, Type: volumeType, Description: res.Description, + Labels: res.Labels, } if isMultiZone(volumeAZ) { @@ -318,6 +319,7 @@ func (b *VolumeSnapshotter) createSnapshot(snapshotName, volumeID, volumeAZ stri Description: getSnapshotTags(tags, disk.Description, b.log), SourceDisk: disk.SelfLink, SnapshotType: b.snapshotType, + Labels: disk.Labels, } if b.snapshotLocation != "" { @@ -343,6 +345,7 @@ func (b *VolumeSnapshotter) createRegionSnapshot(snapshotName, volumeID, volumeR Description: getSnapshotTags(tags, disk.Description, b.log), SourceDisk: disk.SelfLink, SnapshotType: b.snapshotType, + Labels: disk.Labels, } if b.snapshotLocation != "" {