Skip to content

Commit

Permalink
Use same naming strategy as for cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed Nov 23, 2022
1 parent 4adb74e commit 2c0af4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/dev/podmandev/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ func createPodFromComponent(
Name: storage.OdoSourceVolume,
VolumeSource: corev1.VolumeSource{
PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
ClaimName: getVolumeName(componentName, appName, "source"),
ClaimName: getVolumeName(componentName, appName, "odo-projects"),
},
},
},
{
Name: storage.SharedDataVolumeName,
VolumeSource: corev1.VolumeSource{
PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
ClaimName: getVolumeName(componentName, appName, "shared"),
ClaimName: getVolumeName(componentName, appName, "odo-shared"),
},
},
},
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions pkg/dev/podmandev/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ var (
Name: "odo-projects",
VolumeSource: corev1.VolumeSource{
PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
ClaimName: "odo-projects-mycmp-app-source",
ClaimName: "odo-projects-mycmp-app",
},
},
},
{
Name: "odo-shared-data",
VolumeSource: corev1.VolumeSource{
PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
ClaimName: "odo-projects-mycmp-app-shared",
ClaimName: "odo-shared-mycmp-app",
},
},
},
Expand Down Expand Up @@ -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,
},
},
})
Expand Down

0 comments on commit 2c0af4d

Please sign in to comment.