From f4a1e1d2ff4c998c1fae35fce233739c5c0b9843 Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Wed, 23 Nov 2022 12:59:21 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Parthvi Vala --- pkg/dev/podmandev/pod.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/dev/podmandev/pod.go b/pkg/dev/podmandev/pod.go index e97a2462a98..d2bc2fce2dc 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, "odo-projects"), + ClaimName: getVolumeName(storage.OdoSourceVolume, componentName, appName), }, }, }, @@ -52,7 +52,7 @@ func createPodFromComponent( Name: storage.SharedDataVolumeName, VolumeSource: corev1.VolumeSource{ PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ - ClaimName: getVolumeName(componentName, appName, "odo-shared"), + ClaimName: getVolumeName(storage.SharedDataVolumeName, componentName, appName), }, }, }, @@ -68,7 +68,7 @@ func createPodFromComponent( Name: devfileVolume.Name, VolumeSource: corev1.VolumeSource{ PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ - ClaimName: getVolumeName(componentName, appName, devfileVolume.Name), + ClaimName: getVolumeName(devfileVolume.Name, componentName, appName), }, }, }) @@ -96,7 +96,7 @@ func createPodFromComponent( return &pod, fwPorts, nil } -func getVolumeName(componentName string, appName string, volume string) string { +func getVolumeName(volume string, componentName string, appName string) string { return volume + "-" + componentName + "-" + appName }