Skip to content

Commit d135ea0

Browse files
author
smiletan
committed
only be need
1 parent 405d7cb commit d135ea0

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

pkg/controller/sub_controller/disaggregated_subcontroller.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -345,20 +345,25 @@ func (d *DisaggregatedSubDefaultController) PersistentVolumeBuildVolumesVolumeMo
345345
pathName[cachePaths[i]] = path_i
346346
requiredPaths = append(requiredPaths, cachePaths[i])
347347
}
348-
default:
349348

350-
}
349+
//generate the last path's name, the ordinal is length of cache paths.
350+
baseIndex := len(cachePaths)
351+
for _, path := range v1pv.MountPaths {
352+
if _, ok := pathName[path]; ok {
353+
//compatible before name= storage+i
354+
continue
355+
}
351356

352-
for _, path := range v1pv.MountPaths {
353-
if _, ok := pathName[path]; ok {
354-
//compatible before name= storage+i
355-
continue
357+
requiredPaths = append(requiredPaths, path)
358+
pathName[path] = BECacheStorePreName + strconv.Itoa(baseIndex)
359+
baseIndex = baseIndex + 1
356360
}
357361

358-
requiredPaths = append(requiredPaths, path)
359-
pathName[path] = BECacheStorePreName + strconv.Itoa(len(requiredPaths))
362+
default:
363+
360364
}
361365

366+
362367
var vs []corev1.Volume
363368
var vms []corev1.VolumeMount
364369
var pvcs []corev1.PersistentVolumeClaim

0 commit comments

Comments
 (0)