Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit 353e851

Browse files
committed
Update imports
Signed-off-by: Lantao Liu <[email protected]>
1 parent e9e6a98 commit 353e851

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+103
-57
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Build Status](https://api.travis-ci.org/containerd/cri-containerd.svg?style=flat-square)](https://travis-ci.org/containerd/cri-containerd)
88
[![Go Report Card](https://goreportcard.com/badge/github.com/containerd/cri-containerd?style=flat-square)](https://goreportcard.com/report/github.com/containerd/cri-containerd)
99

10-
`cri-containerd` is a [containerd](https://containerd.io/) based implementation of Kubernetes [container runtime interface (CRI)](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/apis/cri/v1alpha1/runtime/api.proto).
10+
`cri-containerd` is a [containerd](https://containerd.io/) based implementation of Kubernetes [container runtime interface (CRI)](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/apis/cri/runtime/v1alpha2/api.proto).
1111

1212
With it, you could run Kubernetes using containerd as the container runtime.
1313
![cri-containerd](./docs/cri-containerd.png)

docs/architecture.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Architecture of CRI-Containerd
22
This document describes the architecture of `cri-containerd`.
33

4-
Cri-containerd is a containerd based implementation of Kubernetes [container runtime interface (CRI)](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/apis/cri/v1alpha1/runtime/api.proto). It operates on the same node as the [Kubelet](https://kubernetes.io/docs/reference/generated/kubelet/) and [containerd](https://github.com/containerd/containerd). Layered between Kubernetes and containerd, cri-containerd handles all CRI service requests from the Kubelet and uses containerd to manage containers and container images.
4+
Cri-containerd is a containerd based implementation of Kubernetes [container runtime interface (CRI)](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/apis/cri/runtime/v1alpha2/api.proto). It operates on the same node as the [Kubelet](https://kubernetes.io/docs/reference/generated/kubelet/) and [containerd](https://github.com/containerd/containerd). Layered between Kubernetes and containerd, cri-containerd handles all CRI service requests from the Kubelet and uses containerd to manage containers and container images.
55

66
Cri-containerd uses containerd to manage the full container lifecycle and all container images. As also shown below, cri-containerd manages pod networking via [CNI](https://github.com/containernetworking/cni) (another CNCF project).
77

integration/container_stats_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
"github.com/stretchr/testify/assert"
2525
"github.com/stretchr/testify/require"
26-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
26+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2727
)
2828

2929
// Test to verify for a container ID

integration/container_update_resources_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/stretchr/testify/assert"
2525
"github.com/stretchr/testify/require"
2626
"golang.org/x/net/context"
27-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
27+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2828
)
2929

3030
func checkMemoryLimit(t *testing.T, spec *runtimespec.Spec, memLimit int64) {

integration/image_load_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
"github.com/stretchr/testify/assert"
2727
"github.com/stretchr/testify/require"
28-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
28+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2929

3030
api "github.com/containerd/cri-containerd/pkg/api/v1"
3131
)

integration/imagefs_info_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
"github.com/stretchr/testify/assert"
2626
"github.com/stretchr/testify/require"
27-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
27+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2828
)
2929

3030
func TestImageFSInfo(t *testing.T) {

integration/restart_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"github.com/stretchr/testify/require"
2828
"golang.org/x/net/context"
2929
"golang.org/x/sys/unix"
30-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
30+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
3131
)
3232

3333
// Restart test must run sequentially.

integration/sandbox_clean_remove_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/stretchr/testify/assert"
2525
"github.com/stretchr/testify/require"
2626
"golang.org/x/net/context"
27-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
27+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2828
)
2929

3030
func TestSandboxCleanRemove(t *testing.T) {

integration/test_utils.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/containerd/containerd"
2727
"github.com/sirupsen/logrus"
2828
"k8s.io/kubernetes/pkg/kubelet/apis/cri"
29-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
29+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
3030
"k8s.io/kubernetes/pkg/kubelet/remote"
3131

3232
api "github.com/containerd/cri-containerd/pkg/api/v1"

integration/truncindex_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
"github.com/stretchr/testify/assert"
2323
"github.com/stretchr/testify/require"
24-
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
24+
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2525
)
2626

2727
func genTruncIndex(normalName string) string {

integration/volume_copy_up_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
"github.com/stretchr/testify/assert"
2626
"github.com/stretchr/testify/require"
27-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
27+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2828
)
2929

3030
func TestVolumeCopyUp(t *testing.T) {

pkg/server/container_attach.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/sirupsen/logrus"
2525
"golang.org/x/net/context"
2626
"k8s.io/client-go/tools/remotecommand"
27-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
27+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2828

2929
cio "github.com/containerd/cri-containerd/pkg/server/io"
3030
)

pkg/server/container_exec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"fmt"
2121

2222
"golang.org/x/net/context"
23-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
23+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2424
)
2525

2626
// Exec prepares a streaming endpoint to execute a command in the container, and returns the address.

pkg/server/container_execsync.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
"golang.org/x/net/context"
3030
"golang.org/x/sys/unix"
3131
"k8s.io/client-go/tools/remotecommand"
32-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
32+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
3333

3434
cioutil "github.com/containerd/cri-containerd/pkg/ioutil"
3535
cio "github.com/containerd/cri-containerd/pkg/server/io"

pkg/server/container_list.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package server
1919
import (
2020
"golang.org/x/net/context"
2121

22-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
22+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2323

2424
containerstore "github.com/containerd/cri-containerd/pkg/store/container"
2525
)

pkg/server/container_list_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/stretchr/testify/assert"
2424
"github.com/stretchr/testify/require"
2525
"golang.org/x/net/context"
26-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
26+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2727

2828
containerstore "github.com/containerd/cri-containerd/pkg/store/container"
2929
sandboxstore "github.com/containerd/cri-containerd/pkg/store/sandbox"

pkg/server/container_log_reopen.go

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
Copyright 2018 The Containerd Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package server
18+
19+
import (
20+
"errors"
21+
"golang.org/x/net/context"
22+
23+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
24+
)
25+
26+
// ReopenContainerLog asks cri-containerd to reopen the stdout/stderr log file for the container.
27+
// This is often called after the log file has been rotated.
28+
// TODO(random-liu): Implement this for kubelet log rotation.
29+
func (c *criContainerdService) ReopenContainerLog(ctx context.Context, r *runtime.ReopenContainerLogRequest) (*runtime.ReopenContainerLogResponse, error) {
30+
return nil, errors.New("not implemented")
31+
}

pkg/server/container_remove.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/docker/docker/pkg/system"
2525
"github.com/sirupsen/logrus"
2626
"golang.org/x/net/context"
27-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
27+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2828

2929
"github.com/containerd/cri-containerd/pkg/log"
3030
"github.com/containerd/cri-containerd/pkg/store"

pkg/server/container_start.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/containerd/containerd/errdefs"
2727
"github.com/sirupsen/logrus"
2828
"golang.org/x/net/context"
29-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
29+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
3030

3131
cio "github.com/containerd/cri-containerd/pkg/server/io"
3232
containerstore "github.com/containerd/cri-containerd/pkg/store/container"

pkg/server/container_stats.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
tasks "github.com/containerd/containerd/api/services/tasks/v1"
2323
"golang.org/x/net/context"
24-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
24+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2525
)
2626

2727
// ContainerStats returns stats of the container. If the container does not

pkg/server/container_stats_list.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/containerd/containerd/api/types"
2525
"github.com/containerd/typeurl"
2626
"golang.org/x/net/context"
27-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
27+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2828

2929
containerstore "github.com/containerd/cri-containerd/pkg/store/container"
3030
)

pkg/server/container_status.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
2424
"github.com/sirupsen/logrus"
2525
"golang.org/x/net/context"
26-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
26+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2727

2828
containerstore "github.com/containerd/cri-containerd/pkg/store/container"
2929
)

pkg/server/container_status_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
"github.com/stretchr/testify/assert"
2424
"golang.org/x/net/context"
25-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
25+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2626

2727
containerstore "github.com/containerd/cri-containerd/pkg/store/container"
2828
imagestore "github.com/containerd/cri-containerd/pkg/store/image"

pkg/server/container_stop.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/sirupsen/logrus"
2727
"golang.org/x/net/context"
2828
"golang.org/x/sys/unix"
29-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
29+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
3030

3131
containerstore "github.com/containerd/cri-containerd/pkg/store/container"
3232
)

pkg/server/container_update_resources.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
2828
"github.com/sirupsen/logrus"
2929
"golang.org/x/net/context"
30-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
30+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
3131

3232
containerstore "github.com/containerd/cri-containerd/pkg/store/container"
3333
"github.com/containerd/cri-containerd/pkg/util"

pkg/server/container_update_resources_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"github.com/golang/protobuf/proto"
2323
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
2424
"github.com/stretchr/testify/assert"
25-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
25+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2626
)
2727

2828
func TestUpdateOCILinuxResource(t *testing.T) {

pkg/server/helpers_selinux_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
"github.com/opencontainers/selinux/go-selinux"
2525
"github.com/stretchr/testify/assert"
26-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
26+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2727
)
2828

2929
func TestInitSelinuxOpts(t *testing.T) {

pkg/server/image_list.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package server
1818

1919
import (
2020
"golang.org/x/net/context"
21-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
21+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2222

2323
imagestore "github.com/containerd/cri-containerd/pkg/store/image"
2424
)

pkg/server/image_list_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/stretchr/testify/assert"
2424
"github.com/stretchr/testify/require"
2525
"golang.org/x/net/context"
26-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
26+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2727

2828
imagestore "github.com/containerd/cri-containerd/pkg/store/image"
2929
)

pkg/server/image_pull.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
2929
"github.com/sirupsen/logrus"
3030
"golang.org/x/net/context"
31-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
31+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
3232

3333
containerdresolver "github.com/containerd/cri-containerd/pkg/containerd/resolver"
3434
imagestore "github.com/containerd/cri-containerd/pkg/store/image"

pkg/server/image_pull_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"testing"
2222

2323
"github.com/stretchr/testify/assert"
24-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
24+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2525
)
2626

2727
func TestParseAuth(t *testing.T) {

pkg/server/image_remove.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/containerd/containerd/images"
2424
"github.com/sirupsen/logrus"
2525
"golang.org/x/net/context"
26-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
26+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2727
)
2828

2929
// RemoveImage removes the image.

pkg/server/image_status.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
"github.com/sirupsen/logrus"
2424
"golang.org/x/net/context"
25-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
25+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2626

2727
imagestore "github.com/containerd/cri-containerd/pkg/store/image"
2828
imagespec "github.com/opencontainers/image-spec/specs-go/v1"

pkg/server/image_status_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/stretchr/testify/assert"
2424
"github.com/stretchr/testify/require"
2525
"golang.org/x/net/context"
26-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
26+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2727

2828
imagestore "github.com/containerd/cri-containerd/pkg/store/image"
2929
)

pkg/server/imagefs_info.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
"golang.org/x/net/context"
2323

24-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
24+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2525
)
2626

2727
// ImageFsInfo returns information of the filesystem that is used to store images.

pkg/server/imagefs_info_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/stretchr/testify/assert"
2424
"github.com/stretchr/testify/require"
2525
"golang.org/x/net/context"
26-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
26+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2727

2828
snapshotstore "github.com/containerd/cri-containerd/pkg/store/snapshot"
2929
)

pkg/server/instrumented_service.go

+16-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
"github.com/sirupsen/logrus"
2323
"golang.org/x/net/context"
24-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
24+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
2525

2626
api "github.com/containerd/cri-containerd/pkg/api/v1"
2727
"github.com/containerd/cri-containerd/pkg/log"
@@ -461,3 +461,18 @@ func (in *instrumentedService) LoadImage(ctx context.Context, r *api.LoadImageRe
461461
}()
462462
return in.c.LoadImage(ctx, r)
463463
}
464+
465+
func (in *instrumentedService) ReopenContainerLog(ctx context.Context, r *runtime.ReopenContainerLogRequest) (res *runtime.ReopenContainerLogResponse, err error) {
466+
if err := in.checkInitialized(); err != nil {
467+
return nil, err
468+
}
469+
logrus.Debugf("ReopenContainerLog for %q", r.GetContainerId())
470+
defer func() {
471+
if err != nil {
472+
logrus.WithError(err).Errorf("ReopenContainerLog for %q failed", r.GetContainerId())
473+
} else {
474+
logrus.Debugf("ReopenContainerLog for %q returns successfully", r.GetContainerId())
475+
}
476+
}()
477+
return in.c.ReopenContainerLog(ctx, r)
478+
}

pkg/server/io/helpers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/containerd/containerd/cio"
2727
"github.com/containerd/fifo"
2828
"golang.org/x/net/context"
29-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
29+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
3030
)
3131

3232
// AttachOptions specifies how to attach to a container.

pkg/server/io/logger.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"time"
2727

2828
"github.com/sirupsen/logrus"
29-
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
29+
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
3030

3131
cioutil "github.com/containerd/cri-containerd/pkg/ioutil"
3232
)

0 commit comments

Comments
 (0)