@@ -5,11 +5,15 @@ import (
55 manilav1 "github.com/openstack-k8s-operators/manila-operator/api/v1beta1"
66 "github.com/openstack-k8s-operators/manila-operator/pkg/manila"
77 corev1 "k8s.io/api/core/v1"
8- "strings"
98)
109
1110// GetVolumes -
12- func GetVolumes (parentName string , name string , extraVol []manilav1.ManilaExtraVolMounts ) []corev1.Volume {
11+ func GetVolumes (
12+ parentName string ,
13+ name string ,
14+ extraVol []manilav1.ManilaExtraVolMounts ,
15+ propagationInstanceName string ,
16+ ) []corev1.Volume {
1317 var config0644AccessMode int32 = 0644
1418 var dirOrCreate = corev1 .HostPathDirectoryOrCreate
1519
@@ -35,12 +39,15 @@ func GetVolumes(parentName string, name string, extraVol []manilav1.ManilaExtraV
3539 }
3640
3741 // Set the propagation levels for ManilaShare, including the backend name
38- propagation := append (manila .ManilaSharePropagation , storage .PropagationType (strings . TrimPrefix ( name , "manila-share-" ) ))
42+ propagation := append (manila .ManilaSharePropagation , storage .PropagationType (propagationInstanceName ))
3943 return append (manila .GetVolumes (parentName , extraVol , propagation ), shareVolumes ... )
4044}
4145
4246// GetVolumeMounts - Manila Share VolumeMounts
43- func GetVolumeMounts (name string , extraVol []manilav1.ManilaExtraVolMounts ) []corev1.VolumeMount {
47+ func GetVolumeMounts (
48+ extraVol []manilav1.ManilaExtraVolMounts ,
49+ propagationInstanceName string ,
50+ ) []corev1.VolumeMount {
4451 shareVolumeMounts := []corev1.VolumeMount {
4552 {
4653 Name : "config-data-custom" ,
@@ -59,6 +66,6 @@ func GetVolumeMounts(name string, extraVol []manilav1.ManilaExtraVolMounts) []co
5966 }
6067
6168 // Set the propagation levels for ManilaShare, including the backend name
62- propagation := append (manila .ManilaSharePropagation , storage .PropagationType (strings . TrimPrefix ( name , "manila-share-" ) ))
69+ propagation := append (manila .ManilaSharePropagation , storage .PropagationType (propagationInstanceName ))
6370 return append (manila .GetVolumeMounts (extraVol , propagation ), shareVolumeMounts ... )
6471}
0 commit comments