Removing volume directory fix
Directory mounted in the container wasn't removed along the container so we ended up with a lot of empty directories on the server.
This commit is contained in:
parent
81b3d45a4b
commit
c11de8a3e9
1 changed files with 7 additions and 1 deletions
|
@ -62,7 +62,7 @@ func du(path string) (int, int, error) {
|
|||
return space, inodes, nil
|
||||
}
|
||||
|
||||
// Removes content of given directory
|
||||
// Removes content of given directory and then the directory itself
|
||||
func removeDirectory(dir string) error {
|
||||
d, err := os.Open(dir)
|
||||
if err != nil {
|
||||
|
@ -79,6 +79,12 @@ func removeDirectory(dir string) error {
|
|||
return err
|
||||
}
|
||||
}
|
||||
|
||||
err = os.Remove(filepath.Join(dir))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue