diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-10-23 00:18:39 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-10-23 00:18:39 +0000 |
commit | c555aded4ece1df6b2d86100c31bd116af08e943 (patch) | |
tree | 6477f467074845e5f6ae140140ac89e1e6a6abcb /runsc/container | |
parent | efef85c6e7fda34c567b05377274fe2f20ee65a0 (diff) | |
parent | 6122b413f132ecc0646ef446f89dd5eaf0b55b08 (diff) |
Merge release-20190806.1-306-g6122b41 (automated)
Diffstat (limited to 'runsc/container')
-rw-r--r-- | runsc/container/container.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runsc/container/container.go b/runsc/container/container.go index a721c1c31..32510d427 100644 --- a/runsc/container/container.go +++ b/runsc/container/container.go @@ -1149,7 +1149,7 @@ func maybeLockRootContainer(spec *specs.Spec, rootDir string) (func() error, err } func isRoot(spec *specs.Spec) bool { - return specutils.ShouldCreateSandbox(spec) + return specutils.SpecContainerType(spec) != specutils.ContainerTypeContainer } // runInCgroup executes fn inside the specified cgroup. If cg is nil, execute @@ -1198,7 +1198,7 @@ func adjustSandboxOOMScoreAdj(s *sandbox.Sandbox, rootDir string, destroy bool) // Get the lowest score for all containers. var lowScore int scoreFound := false - if len(containers) == 1 && len(containers[0].Spec.Annotations[specutils.ContainerdContainerTypeAnnotation]) == 0 { + if len(containers) == 1 && specutils.SpecContainerType(containers[0].Spec) == specutils.ContainerTypeUnspecified { // This is a single-container sandbox. Set the oom_score_adj to // the value specified in the OCI bundle. if containers[0].Spec.Process.OOMScoreAdj != nil { @@ -1214,7 +1214,7 @@ func adjustSandboxOOMScoreAdj(s *sandbox.Sandbox, rootDir string, destroy bool) // // We will use OOMScoreAdj in the single-container case where the // containerd container-type annotation is not present. - if container.Spec.Annotations[specutils.ContainerdContainerTypeAnnotation] == specutils.ContainerdContainerTypeSandbox { + if specutils.SpecContainerType(container.Spec) == specutils.ContainerTypeSandbox { continue } |