mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-30 17:22:33 +00:00
virtcontainers: Improve debug when create/delete files
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 niteshkonkar@in.ibm.com
This commit is contained in:
parent
d07297c197
commit
a614273af5
@ -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
|
||||
}
|
||||
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user