summaryrefslogtreecommitdiffhomepage
path: root/pkg/v1/utils/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/v1/utils/utils.go')
-rw-r--r--pkg/v1/utils/utils.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/v1/utils/utils.go b/pkg/v1/utils/utils.go
index b89edb064..83840c047 100644
--- a/pkg/v1/utils/utils.go
+++ b/pkg/v1/utils/utils.go
@@ -48,3 +48,12 @@ func IsSandbox(spec *specs.Spec) bool {
t, ok := spec.Annotations[annotations.ContainerType]
return !ok || t == annotations.ContainerTypeSandbox
}
+
+// UserLogPath gets user log path from OCI annotation.
+func UserLogPath(spec *specs.Spec) string {
+ sandboxLogDir := spec.Annotations[annotations.SandboxLogDir]
+ if sandboxLogDir == "" {
+ return ""
+ }
+ return filepath.Join(sandboxLogDir, "gvisor.log")
+}