Merge pull request #456 from Random-Liu/fix-shim-cgroup-change

Move shim cgroup opts to pkg/containerd/opts.
This commit is contained in:
Lantao Liu 2017-12-01 12:18:34 -08:00 committed by GitHub
commit 3a0d40cc2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,16 @@
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package opts
import (

View File

@ -27,7 +27,7 @@ import (
"golang.org/x/net/context"
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
criopts "github.com/kubernetes-incubator/cri-containerd/pkg/opts"
customopts "github.com/kubernetes-incubator/cri-containerd/pkg/containerd/opts"
cio "github.com/kubernetes-incubator/cri-containerd/pkg/server/io"
containerstore "github.com/kubernetes-incubator/cri-containerd/pkg/store/container"
)
@ -129,7 +129,7 @@ func (c *criContainerdService) startContainer(ctx context.Context,
var taskOpts []containerd.NewTaskOpts
if cgroup := sandbox.Config.GetLinux().GetCgroupParent(); cgroup != "" {
taskOpts = append(taskOpts, criopts.WithContainerdShimCgroup(cgroup))
taskOpts = append(taskOpts, customopts.WithContainerdShimCgroup(cgroup))
}
task, err := container.NewTask(ctx, ioCreation, taskOpts...)
if err != nil {

View File

@ -36,7 +36,6 @@ import (
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
customopts "github.com/kubernetes-incubator/cri-containerd/pkg/containerd/opts"
criopts "github.com/kubernetes-incubator/cri-containerd/pkg/opts"
sandboxstore "github.com/kubernetes-incubator/cri-containerd/pkg/store/sandbox"
"github.com/kubernetes-incubator/cri-containerd/pkg/util"
)
@ -208,7 +207,7 @@ func (c *criContainerdService) RunPodSandbox(ctx context.Context, r *runtime.Run
// We don't need stdio for sandbox container.
var taskOpts []containerd.NewTaskOpts
if cgroup := config.GetLinux().GetCgroupParent(); cgroup != "" {
taskOpts = append(taskOpts, criopts.WithContainerdShimCgroup(cgroup))
taskOpts = append(taskOpts, customopts.WithContainerdShimCgroup(cgroup))
}
task, err := container.NewTask(ctx, containerdio.NullIO, taskOpts...)
if err != nil {