Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit b417cc0

Browse files
authored
Merge pull request #391 from YaoZengzeng/remove-vmdir
Remove "vm-XXX" directory when vm exits
2 parents cd67617 + 4ca99c5 commit b417cc0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

daemon/pod.go

+2
Original file line numberDiff line numberDiff line change
@@ -1049,13 +1049,15 @@ func (p *Pod) Cleanup(daemon *Daemon) {
10491049
}
10501050

10511051
sharedDir := path.Join(hypervisor.BaseDir, p.VM.Id, hypervisor.ShareDirTag)
1052+
vmDir := path.Join(hypervisor.BaseDir, p.VM.Id)
10521053
p.VM = nil
10531054

10541055
daemon.db.DeleteVMByPod(p.Id)
10551056

10561057
p.cleanupVolumes(daemon.Storage, sharedDir)
10571058
p.cleanupMountsAndFiles(daemon.Storage, sharedDir)
10581059
p.cleanupEtcHosts()
1060+
os.RemoveAll(vmDir)
10591061

10601062
p.PodStatus.CleanupExec()
10611063

0 commit comments

Comments
 (0)