Skip to content

Commit 76d635d

Browse files
committed
minor
1 parent 0fe3547 commit 76d635d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/docker/aux.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ func parseContainerCommandAndReturnArgs(Ctx context.Context, config commonIL.Int
3131
for _, podData := range data {
3232
podUID = string(podData.Pod.UID)
3333
podNamespace = string(podData.Pod.Namespace)
34+
35+
// check if the directory exists, if not create it
36+
dirPath := config.DataRootFolder + podData.Pod.Namespace + "-" + podUID
37+
if _, err := os.Stat(dirPath); os.IsNotExist(err) {
38+
err := os.MkdirAll(dirPath, os.ModePerm)
39+
if err != nil {
40+
log.G(Ctx).Error(err)
41+
} else {
42+
log.G(Ctx).Info("-- Created directory " + dirPath)
43+
}
44+
}
45+
3446
}
3547

3648
if container.Command == nil {

0 commit comments

Comments
 (0)