mirror of
https://github.com/MengMengCode/CLICD.git
synced 2026-08-05 05:36:07 +08:00
修复了一些已知问题
This commit is contained in:
@@ -223,6 +223,13 @@ func normalizeStoragePools() bool {
|
||||
if pool.MountPoint == "." {
|
||||
pool.MountPoint = ""
|
||||
}
|
||||
if pool.MountPoint != "" {
|
||||
managedPath := managedStoragePoolPath(pool.MountPoint)
|
||||
if pool.Path != managedPath {
|
||||
pool.Path = managedPath
|
||||
changed = true
|
||||
}
|
||||
}
|
||||
if pool.ID == "" {
|
||||
pool.ID = storagePoolIDFromName(pool.Name, pool.Path)
|
||||
changed = true
|
||||
@@ -264,6 +271,14 @@ func normalizeStoragePools() bool {
|
||||
return changed
|
||||
}
|
||||
|
||||
func managedStoragePoolPath(mountPoint string) string {
|
||||
mountPoint = filepath.Clean(strings.TrimSpace(mountPoint))
|
||||
if mountPoint == string(os.PathSeparator) {
|
||||
return filepath.Join(string(os.PathSeparator), "var", "lib", "clicd")
|
||||
}
|
||||
return filepath.Join(mountPoint, "clicd")
|
||||
}
|
||||
|
||||
func storagePoolIDFromName(name, path string) string {
|
||||
base := strings.ToLower(strings.TrimSpace(name))
|
||||
if base == "" {
|
||||
|
||||
Reference in New Issue
Block a user