diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-10-22 17:05:04 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-10-22 17:05:04 -0700 |
commit | 6122b413f132ecc0646ef446f89dd5eaf0b55b08 (patch) | |
tree | 860719c2bbd9eb036c45c4c9dc4a8877273ffa32 /runsc/container/container.go | |
parent | ebe8001724a6965cc9723604b38f42563d284a6a (diff) | |
parent | 7e8b5f4a3a1d84dddb4f8ef83e3fe8d2902dfbcf (diff) |
Merge pull request #1046 from tomlanyon:crio
PiperOrigin-RevId: 276172466
Diffstat (limited to 'runsc/container/container.go')
-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 } |