Skip to content

Commit 6b3930c

Browse files
chobostarKirill Petrov
authored andcommitted
Revert "Optimize pvcTemplate Name for Storage OT-CONTAINER-KIT#438 (OT-CONTAINER-KIT#445)" (OT-CONTAINER-KIT#510)
This reverts commit ff6980f. Signed-off-by: chobostar <chobostar85@gmail.com> Co-authored-by: Kirill Petrov <Kirill_Petrov@epam.com> Signed-off-by: guozhi.li <guozhi.li@daocloud.io>
1 parent 6fec8e2 commit 6b3930c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

k8sutils/statefulset.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ func getExternalConfig(configMapName string) []corev1.Volume {
297297
func createPVCTemplate(stsMeta metav1.ObjectMeta, storageSpec corev1.PersistentVolumeClaim) corev1.PersistentVolumeClaim {
298298
pvcTemplate := storageSpec
299299
pvcTemplate.CreationTimestamp = metav1.Time{}
300-
pvcTemplate.Name = "data"
300+
pvcTemplate.Name = stsMeta.GetName()
301301
pvcTemplate.Labels = stsMeta.GetLabels()
302302
// We want the same annoations as the StatefulSet here
303303
pvcTemplate.Annotations = generateStatefulSetsAnots(stsMeta)
@@ -476,7 +476,7 @@ func getVolumeMount(name string, persistenceEnabled *bool, externalConfig *strin
476476

477477
if persistenceEnabled != nil && *persistenceEnabled {
478478
VolumeMounts = append(VolumeMounts, corev1.VolumeMount{
479-
Name: "data",
479+
Name: name,
480480
MountPath: "/data",
481481
})
482482
}

0 commit comments

Comments
 (0)