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:
Steve Kriss
2019-12-05 12:54:19 -08:00
committed by Carlisia Campos
parent 91bbb98cab
commit f42406723c
2 changed files with 5 additions and 3 deletions
+1
View File
@@ -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
+4 -3
View File
@@ -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