Do not replace labels of pvc with those of StastefulSet
This commit is contained in:
parent
f5574bf62a
commit
751007c17d
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user