Skip to content

Commit 6d19731

Browse files
committed
Merge remote-tracking branch 'origin/main' into 2-light-version-no-gpu
2 parents fecb037 + 76d635d commit 6d19731

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
@@ -29,6 +29,18 @@ func parseContainerCommandAndReturnArgs(Ctx context.Context, config commonIL.Int
2929
for _, podData := range data {
3030
podUID = string(podData.Pod.UID)
3131
podNamespace = string(podData.Pod.Namespace)
32+
33+
// check if the directory exists, if not create it
34+
dirPath := config.DataRootFolder + podData.Pod.Namespace + "-" + podUID
35+
if _, err := os.Stat(dirPath); os.IsNotExist(err) {
36+
err := os.MkdirAll(dirPath, os.ModePerm)
37+
if err != nil {
38+
log.G(Ctx).Error(err)
39+
} else {
40+
log.G(Ctx).Info("-- Created directory " + dirPath)
41+
}
42+
}
43+
3244
}
3345

3446
if container.Command == nil {

0 commit comments

Comments
 (0)