Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: copy labels from Disk to Snapshot #178

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions velero-plugin-for-gcp/volume_snapshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 != "" {
Expand All @@ -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 != "" {
Expand Down
Loading