Do not replace labels of pvc with those of StastefulSet

This commit is contained in:
caiweidong 2019-03-12 00:34:21 +08:00
parent f5574bf62a
commit 751007c17d

View File

@ -149,7 +149,15 @@ func getPersistentVolumeClaims(set *apps.StatefulSet, pod *v1.Pod) map[string]v1
claim := templates[i] claim := templates[i]
claim.Name = getPersistentVolumeClaimName(set, &claim, ordinal) claim.Name = getPersistentVolumeClaimName(set, &claim, ordinal)
claim.Namespace = set.Namespace claim.Namespace = set.Namespace
claim.Labels = set.Spec.Selector.MatchLabels if claim.Labels != nil {
for key, value := range set.Spec.Selector.MatchLabels {
if claim.Labels != nil {
claim.Labels[key] = value
}
}
} else {
claim.Labels = set.Spec.Selector.MatchLabels
}
claims[templates[i].Name] = claim claims[templates[i].Name] = claim
} }
return claims return claims