mirror of
https://github.com/MengMengCode/CLICD.git
synced 2026-08-08 06:24:44 +08:00
添加了子用户列表功能
This commit is contained in:
@@ -1479,11 +1479,20 @@ func (m *Manager) DestroyContainer(id int) error {
|
||||
}
|
||||
return fmt.Errorf("container still exists after cleanup with status %s", status)
|
||||
}
|
||||
snapshotDir := filepath.Join(snapshotBaseDir(), lxcName)
|
||||
// Remove snapshot physical files (by container ID, not lxcName)
|
||||
snapshotDir := filepath.Join(snapshotBaseDir(), strconv.Itoa(id))
|
||||
if err := safePathUnder(snapshotDir, snapshotBaseDir()); err == nil {
|
||||
os.RemoveAll(snapshotDir)
|
||||
}
|
||||
|
||||
// Also remove any legacy snapshot dir that used lxcName
|
||||
legacySnapshotDir := filepath.Join(snapshotBaseDir(), lxcName)
|
||||
if legacySnapshotDir != snapshotDir {
|
||||
if err := safePathUnder(legacySnapshotDir, snapshotBaseDir()); err == nil {
|
||||
os.RemoveAll(legacySnapshotDir)
|
||||
}
|
||||
}
|
||||
|
||||
if !config.RemoveContainer(id) {
|
||||
return fmt.Errorf("container destroyed but config entry was not removed: %d", id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user