mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-08-15 11:46:06 +00:00
bug fix: deep-copy backup's labels for snapshot tags (#2075)
* bug fix: deep-copy backup's labels for snapshot tags Signed-off-by: Steve Kriss <krisss@vmware.com>
This commit is contained in:
committed by
Carlisia Campos
parent
91bbb98cab
commit
f42406723c
@@ -0,0 +1 @@
|
||||
bug fix: deep-copy backup's labels when constructing snapshot tags, so the PV name isn't added as a label to the backup
|
||||
@@ -456,9 +456,10 @@ func (ib *defaultItemBackupper) takePVSnapshot(obj runtime.Unstructured, log log
|
||||
|
||||
log = log.WithField("volumeID", volumeID)
|
||||
|
||||
tags := ib.backupRequest.GetLabels()
|
||||
if tags == nil {
|
||||
tags = map[string]string{}
|
||||
// create tags from the backup's labels
|
||||
tags := map[string]string{}
|
||||
for k, v := range ib.backupRequest.GetLabels() {
|
||||
tags[k] = v
|
||||
}
|
||||
tags["velero.io/backup"] = ib.backupRequest.Name
|
||||
tags["velero.io/pv"] = pv.Name
|
||||
|
||||
Reference in New Issue
Block a user