diff options
author | Lantao Liu <taotaotheripper@gmail.com> | 2019-03-08 17:53:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-08 17:53:36 -0800 |
commit | b7015c1a46fbea47ad8e7985583b30bd918ddc4b (patch) | |
tree | 4d1568f811e5772aa90120d96a0b53cdf85c42c4 /pkg/v1/utils/utils.go | |
parent | 326bc9f3bac1b89414950772ac0cb87619b847d9 (diff) |
Put the gvisor user log into sandbox log directory. (#17)
Signed-off-by: Lantao Liu <lantaol@google.com>
Diffstat (limited to 'pkg/v1/utils/utils.go')
-rw-r--r-- | pkg/v1/utils/utils.go | 9 |
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") +} |