You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Only the last data pvc template configuration takes effect
98
99
vartemplate*dorisv1.PersistentVolume
99
100
// pvs is the pvc that needs to be actually created, specified by the user
100
101
varpvs []dorisv1.PersistentVolume
101
-
102
102
fori:=rangespec.PersistentVolumes {
103
103
ifspec.PersistentVolumes[i].MountPath!="" {
104
-
pvs=append(pvs, spec.PersistentVolumes[i])
105
-
104
+
path:=spec.PersistentVolumes[i].MountPath
105
+
ifstrings.HasSuffix(path, "/") {
106
+
path=path[:len(path)-1]
107
+
}
108
+
if!set.ArrayContains(sharedPaths, path) {
109
+
pvs=append(pvs, spec.PersistentVolumes[i])
110
+
} else {
111
+
klog.Errorf("GenerateEveryoneMountPathPersistentVolume SharedPersistentVolumeClaim.MountPath (%s) conflicts with the MountPath configured in BaseSpec.PersistentVolumes, "+
112
+
"and the SharedPersistentVolumeClaims configuration takes precedence, skipping the processing of the BaseSpec.PersistentVolumes for the PVC. "+
113
+
"If it does not meet expectations, please handle the conflict and rebuild the cluster.", path)
114
+
}
106
115
} else {
107
116
template= (&spec.PersistentVolumes[i]).DeepCopy()
108
117
}
@@ -139,14 +148,26 @@ func GenerateEveryoneMountPathPersistentVolume(spec *dorisv1.BaseSpec, config ma
139
148
iflen(dataPaths) ==1 {
140
149
tmp:=*template.DeepCopy()
141
150
tmp.MountPath=dataPaths[0]
142
-
pvs=append(pvs, tmp)
151
+
if!set.ArrayContains(sharedPaths, dataPaths[0]) {
152
+
pvs=append(pvs, tmp)
153
+
} else {
154
+
klog.Errorf("GenerateEveryoneMountPathPersistentVolume SharedPersistentVolumeClaims.MountPath (%s) conflicts with the MountPath configured in BaseSpec.PersistentVolumes, "+
155
+
"and the SharedPersistentVolumeClaims configuration takes precedence, skipping the processing of the BaseSpec.PersistentVolumes for the PVC. "+
156
+
"If it does not meet expectations, please handle the conflict and rebuild the cluster.", dataPaths[0])
157
+
}
143
158
} else {
144
159
pathNames:=doris.GetNameOfEachPath(dataPaths)
145
160
fori:=rangedataPaths {
146
161
tmp:=*template.DeepCopy()
147
162
tmp.Name=tmp.Name+"-"+pathNames[i]
148
163
tmp.MountPath=dataPaths[i]
149
-
pvs=append(pvs, tmp)
164
+
if!set.ArrayContains(sharedPaths, dataPaths[i]) {
165
+
pvs=append(pvs, tmp)
166
+
} else {
167
+
klog.Errorf("GenerateEveryoneMountPathPersistentVolume SharedPersistentVolumeClaims.MountPath (%s) conflicts with the MountPath configured in BaseSpec.PersistentVolumes, "+
168
+
"and the SharedPersistentVolumeClaims configuration takes precedence, skipping the processing of the BaseSpec.PersistentVolumes for the PVC. "+
169
+
"If it does not meet expectations, please handle the conflict and rebuild the cluster.", dataPaths[i])
0 commit comments