Skip to content

Commit

Permalink
Merge pull request #456 from Random-Liu/fix-shim-cgroup-change
Browse files Browse the repository at this point in the history
Move shim cgroup opts to pkg/containerd/opts.
  • Loading branch information
Random-Liu committed Dec 1, 2017
2 parents 4a5431e + 181d7d5 commit 3a0d40c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
13 changes: 13 additions & 0 deletions pkg/opts/task.go → pkg/containerd/opts/task.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions pkg/server/container_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions pkg/server/sandbox_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 3a0d40c

Please sign in to comment.