Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Parthvi Vala <[email protected]>
  • Loading branch information
feloy and valaparthvi committed Nov 23, 2022
1 parent 2c0af4d commit bfd25e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 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, "odo-projects"),
ClaimName: getVolumeName(storage.OdoSourceVolume, componentName, appName),
},
},
},
{
Name: storage.SharedDataVolumeName,
VolumeSource: corev1.VolumeSource{
PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
ClaimName: getVolumeName(componentName, appName, "odo-shared"),
ClaimName: getVolumeName(storage.SharedDataVolumeName, componentName, appName),
},
},
},
Expand All @@ -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),
},
},
})
Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/dev/podmandev/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ var (
Name: "odo-shared-data",
VolumeSource: corev1.VolumeSource{
PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
ClaimName: "odo-shared-mycmp-app",
ClaimName: "odo-shared-data-mycmp-app",
},
},
},
Expand Down

0 comments on commit bfd25e2

Please sign in to comment.