From b7015c1a46fbea47ad8e7985583b30bd918ddc4b Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Fri, 8 Mar 2019 17:53:36 -0800 Subject: Put the gvisor user log into sandbox log directory. (#17) Signed-off-by: Lantao Liu --- pkg/v1/utils/utils.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkg/v1/utils/utils.go') 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") +} -- cgit v1.2.3