From 2c0af4d543443537f203301dc3e1fb33fadc0828 Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Wed, 23 Nov 2022 11:29:54 +0100 Subject: [PATCH] Use same naming strategy as for cluster --- pkg/dev/podmandev/pod.go | 6 +++--- pkg/dev/podmandev/pod_test.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/dev/podmandev/pod.go b/pkg/dev/podmandev/pod.go index fc678929ab9..e97a2462a98 100644 --- a/pkg/dev/podmandev/pod.go +++ b/pkg/dev/podmandev/pod.go @@ -44,7 +44,7 @@ func createPodFromComponent( Name: storage.OdoSourceVolume, VolumeSource: corev1.VolumeSource{ PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ - ClaimName: getVolumeName(componentName, appName, "source"), + ClaimName: getVolumeName(componentName, appName, "odo-projects"), }, }, }, @@ -52,7 +52,7 @@ func createPodFromComponent( Name: storage.SharedDataVolumeName, VolumeSource: corev1.VolumeSource{ PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ - ClaimName: getVolumeName(componentName, appName, "shared"), + ClaimName: getVolumeName(componentName, appName, "odo-shared"), }, }, }, @@ -97,7 +97,7 @@ func createPodFromComponent( } func getVolumeName(componentName string, appName string, volume string) string { - return "odo-projects-" + componentName + "-" + appName + "-" + volume + return volume + "-" + componentName + "-" + appName } func addHostPorts(containers []corev1.Container) []api.ForwardedPort { diff --git a/pkg/dev/podmandev/pod_test.go b/pkg/dev/podmandev/pod_test.go index 1cf896770a0..ab3748a95d6 100644 --- a/pkg/dev/podmandev/pod_test.go +++ b/pkg/dev/podmandev/pod_test.go @@ -84,7 +84,7 @@ var ( Name: "odo-projects", VolumeSource: corev1.VolumeSource{ PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ - ClaimName: "odo-projects-mycmp-app-source", + ClaimName: "odo-projects-mycmp-app", }, }, }, @@ -92,7 +92,7 @@ var ( Name: "odo-shared-data", VolumeSource: corev1.VolumeSource{ PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ - ClaimName: "odo-projects-mycmp-app-shared", + ClaimName: "odo-shared-mycmp-app", }, }, }, @@ -304,7 +304,7 @@ func Test_createPodFromComponent(t *testing.T) { Name: volume.Name, VolumeSource: corev1.VolumeSource{ PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ - ClaimName: "odo-projects-" + devfileName + "-" + appName + "-" + volume.Name, + ClaimName: volume.Name + "-" + devfileName + "-" + appName, }, }, })