Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
virtcontainers: Improve debug when create/delete files
Browse files Browse the repository at this point in the history
Adding debug messages which state which files
are being created/deleted could be helpful in
analyzing situations like leaky pod issues.

Fixes: #1234

Signed-off-by: Nitesh Konkar [email protected]
  • Loading branch information
nitkon committed Feb 13, 2019
1 parent d07297c commit a614273
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions virtcontainers/store/filesystem_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,13 @@ func (f *filesystem) initialize() error {
// The root directory, a lock file and a raw files directory.

// Root directory
f.logger().WithField("path", f.path).Debugf("Creating root directory")
if err := os.MkdirAll(f.path, DirMode); err != nil {
return err
}

// Raw directory
f.logger().WithField("path", f.rawPath).Debugf("Creating raw directory")
if err := os.MkdirAll(f.rawPath, DirMode); err != nil {
return err
}
Expand Down Expand Up @@ -186,6 +188,7 @@ func (f *filesystem) new(ctx context.Context, path string, host string) error {
}

func (f *filesystem) delete() error {
f.logger().WithField("path", f.path).Debugf("Deleting files")
return os.RemoveAll(f.path)
}

Expand Down

0 comments on commit a614273

Please sign in to comment.