diff --git a/go.mod b/go.mod index ca89d790d..d982b4b2f 100644 --- a/go.mod +++ b/go.mod @@ -66,7 +66,7 @@ require ( go.opentelemetry.io/otel/sdk v1.3.0 go.opentelemetry.io/otel/trace v1.3.0 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect - golang.org/x/net v0.0.0-20211216030914-fe4d6282115f + golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e diff --git a/integration/container_update_resources_test.go b/integration/container_update_resources_test.go index b7af4d869..c8cdff7ae 100644 --- a/integration/container_update_resources_test.go +++ b/integration/container_update_resources_test.go @@ -21,6 +21,7 @@ package integration import ( "bytes" + "context" "os" "strings" "testing" @@ -31,7 +32,6 @@ import ( runtimespec "github.com/opencontainers/runtime-spec/specs-go" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/integration/containerd_image_test.go b/integration/containerd_image_test.go index c5b0daa95..3c0b16f25 100644 --- a/integration/containerd_image_test.go +++ b/integration/containerd_image_test.go @@ -17,6 +17,7 @@ package integration import ( + "context" "errors" "fmt" "testing" @@ -27,7 +28,6 @@ import ( "github.com/containerd/containerd/namespaces" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/integration/restart_test.go b/integration/restart_test.go index 76ce07fec..d346af86c 100644 --- a/integration/restart_test.go +++ b/integration/restart_test.go @@ -17,6 +17,7 @@ package integration import ( + "context" goruntime "runtime" "sort" "syscall" @@ -27,7 +28,6 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/io/helpers.go b/pkg/cri/io/helpers.go index 2cdc97e1d..4e86b6313 100644 --- a/pkg/cri/io/helpers.go +++ b/pkg/cri/io/helpers.go @@ -17,6 +17,7 @@ package io import ( + "context" "io" "os" "path/filepath" @@ -24,7 +25,6 @@ import ( "syscall" "github.com/containerd/containerd/cio" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/io/helpers_unix.go b/pkg/cri/io/helpers_unix.go index f0f908401..7852b5607 100644 --- a/pkg/cri/io/helpers_unix.go +++ b/pkg/cri/io/helpers_unix.go @@ -20,11 +20,11 @@ package io import ( + "context" "io" "os" "github.com/containerd/fifo" - "golang.org/x/net/context" ) func openPipe(ctx context.Context, fn string, flag int, perm os.FileMode) (io.ReadWriteCloser, error) { diff --git a/pkg/cri/io/helpers_windows.go b/pkg/cri/io/helpers_windows.go index b6c9c1202..a95348e7b 100644 --- a/pkg/cri/io/helpers_windows.go +++ b/pkg/cri/io/helpers_windows.go @@ -17,6 +17,7 @@ package io import ( + "context" "fmt" "io" "net" @@ -24,7 +25,6 @@ import ( "sync" winio "github.com/Microsoft/go-winio" - "golang.org/x/net/context" ) type pipe struct { diff --git a/pkg/cri/server/container_attach.go b/pkg/cri/server/container_attach.go index a95215051..cd79f3bfa 100644 --- a/pkg/cri/server/container_attach.go +++ b/pkg/cri/server/container_attach.go @@ -17,12 +17,12 @@ package server import ( + "context" "fmt" "io" "github.com/containerd/containerd" "github.com/containerd/containerd/log" - "golang.org/x/net/context" "k8s.io/client-go/tools/remotecommand" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/container_create.go b/pkg/cri/server/container_create.go index abfdb937a..a03542ea4 100644 --- a/pkg/cri/server/container_create.go +++ b/pkg/cri/server/container_create.go @@ -17,6 +17,7 @@ package server import ( + "context" "errors" "fmt" "path/filepath" @@ -32,7 +33,6 @@ import ( imagespec "github.com/opencontainers/image-spec/specs-go/v1" runtimespec "github.com/opencontainers/runtime-spec/specs-go" selinux "github.com/opencontainers/selinux/go-selinux" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" cio "github.com/containerd/containerd/pkg/cri/io" diff --git a/pkg/cri/server/container_exec.go b/pkg/cri/server/container_exec.go index 0a27792ec..e33a59493 100644 --- a/pkg/cri/server/container_exec.go +++ b/pkg/cri/server/container_exec.go @@ -17,9 +17,9 @@ package server import ( + "context" "fmt" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/container_execsync.go b/pkg/cri/server/container_execsync.go index 9be392f9c..3bf8d85c0 100644 --- a/pkg/cri/server/container_execsync.go +++ b/pkg/cri/server/container_execsync.go @@ -18,6 +18,7 @@ package server import ( "bytes" + "context" "fmt" "io" "syscall" @@ -28,7 +29,6 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" - "golang.org/x/net/context" "k8s.io/client-go/tools/remotecommand" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/container_list.go b/pkg/cri/server/container_list.go index 6ac9efdc1..931f1be2f 100644 --- a/pkg/cri/server/container_list.go +++ b/pkg/cri/server/container_list.go @@ -17,10 +17,9 @@ package server import ( + "context" "time" - "golang.org/x/net/context" - runtime "k8s.io/cri-api/pkg/apis/runtime/v1" containerstore "github.com/containerd/containerd/pkg/cri/store/container" diff --git a/pkg/cri/server/container_list_test.go b/pkg/cri/server/container_list_test.go index fcac335ca..f2415783f 100644 --- a/pkg/cri/server/container_list_test.go +++ b/pkg/cri/server/container_list_test.go @@ -17,12 +17,12 @@ package server import ( + "context" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" containerstore "github.com/containerd/containerd/pkg/cri/store/container" diff --git a/pkg/cri/server/container_log_reopen.go b/pkg/cri/server/container_log_reopen.go index 292d92d37..1f68df133 100644 --- a/pkg/cri/server/container_log_reopen.go +++ b/pkg/cri/server/container_log_reopen.go @@ -17,11 +17,10 @@ package server import ( + "context" "errors" "fmt" - "golang.org/x/net/context" - runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/container_remove.go b/pkg/cri/server/container_remove.go index 86a52550a..57a80dde1 100644 --- a/pkg/cri/server/container_remove.go +++ b/pkg/cri/server/container_remove.go @@ -17,6 +17,7 @@ package server import ( + "context" "errors" "fmt" "time" @@ -26,7 +27,6 @@ import ( "github.com/containerd/containerd/log" containerstore "github.com/containerd/containerd/pkg/cri/store/container" "github.com/sirupsen/logrus" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/container_start.go b/pkg/cri/server/container_start.go index 35ec64b50..5006ae960 100644 --- a/pkg/cri/server/container_start.go +++ b/pkg/cri/server/container_start.go @@ -17,6 +17,7 @@ package server import ( + "context" "errors" "fmt" "io" @@ -29,7 +30,6 @@ import ( "github.com/containerd/nri" v1 "github.com/containerd/nri/types/v1" "github.com/sirupsen/logrus" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" cio "github.com/containerd/containerd/pkg/cri/io" diff --git a/pkg/cri/server/container_stats.go b/pkg/cri/server/container_stats.go index c2a829635..0ca66eef3 100644 --- a/pkg/cri/server/container_stats.go +++ b/pkg/cri/server/container_stats.go @@ -17,10 +17,10 @@ package server import ( + "context" "fmt" tasks "github.com/containerd/containerd/api/services/tasks/v1" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/container_stats_list.go b/pkg/cri/server/container_stats_list.go index bc796fb98..1d9be7d40 100644 --- a/pkg/cri/server/container_stats_list.go +++ b/pkg/cri/server/container_stats_list.go @@ -17,11 +17,11 @@ package server import ( + "context" "fmt" tasks "github.com/containerd/containerd/api/services/tasks/v1" "github.com/containerd/containerd/api/types" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" containerstore "github.com/containerd/containerd/pkg/cri/store/container" diff --git a/pkg/cri/server/container_status.go b/pkg/cri/server/container_status.go index 9779a090f..9aaa4163f 100644 --- a/pkg/cri/server/container_status.go +++ b/pkg/cri/server/container_status.go @@ -17,6 +17,7 @@ package server import ( + "context" "encoding/json" "fmt" @@ -24,7 +25,6 @@ import ( containerstore "github.com/containerd/containerd/pkg/cri/store/container" runtimespec "github.com/opencontainers/runtime-spec/specs-go" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/container_status_test.go b/pkg/cri/server/container_status_test.go index 6981de109..42c96a131 100644 --- a/pkg/cri/server/container_status_test.go +++ b/pkg/cri/server/container_status_test.go @@ -17,11 +17,11 @@ package server import ( + "context" "testing" "time" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" containerstore "github.com/containerd/containerd/pkg/cri/store/container" diff --git a/pkg/cri/server/container_stop.go b/pkg/cri/server/container_stop.go index 80854fe8b..541772f37 100644 --- a/pkg/cri/server/container_stop.go +++ b/pkg/cri/server/container_stop.go @@ -17,6 +17,7 @@ package server import ( + "context" "fmt" "sync/atomic" "syscall" @@ -29,7 +30,6 @@ import ( ctrdutil "github.com/containerd/containerd/pkg/cri/util" "github.com/moby/sys/signal" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/container_stop_test.go b/pkg/cri/server/container_stop_test.go index 508560d4a..83749132c 100644 --- a/pkg/cri/server/container_stop_test.go +++ b/pkg/cri/server/container_stop_test.go @@ -17,11 +17,11 @@ package server import ( + "context" "testing" "time" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" containerstore "github.com/containerd/containerd/pkg/cri/store/container" ) diff --git a/pkg/cri/server/container_update_resources.go b/pkg/cri/server/container_update_resources.go index e5f6466a1..5267bd540 100644 --- a/pkg/cri/server/container_update_resources.go +++ b/pkg/cri/server/container_update_resources.go @@ -20,6 +20,7 @@ package server import ( + "context" gocontext "context" "fmt" @@ -29,7 +30,6 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/typeurl" runtimespec "github.com/opencontainers/runtime-spec/specs-go" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" containerstore "github.com/containerd/containerd/pkg/cri/store/container" diff --git a/pkg/cri/server/container_update_resources_linux.go b/pkg/cri/server/container_update_resources_linux.go index a30d194e6..954487867 100644 --- a/pkg/cri/server/container_update_resources_linux.go +++ b/pkg/cri/server/container_update_resources_linux.go @@ -17,10 +17,10 @@ package server import ( + "context" "fmt" runtimespec "github.com/opencontainers/runtime-spec/specs-go" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" criconfig "github.com/containerd/containerd/pkg/cri/config" diff --git a/pkg/cri/server/container_update_resources_other.go b/pkg/cri/server/container_update_resources_other.go index 76000e1f6..b59c470d8 100644 --- a/pkg/cri/server/container_update_resources_other.go +++ b/pkg/cri/server/container_update_resources_other.go @@ -20,9 +20,9 @@ package server import ( + "context" "fmt" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" containerstore "github.com/containerd/containerd/pkg/cri/store/container" diff --git a/pkg/cri/server/container_update_resources_windows.go b/pkg/cri/server/container_update_resources_windows.go index 74ce4b3e4..9ce21aca8 100644 --- a/pkg/cri/server/container_update_resources_windows.go +++ b/pkg/cri/server/container_update_resources_windows.go @@ -17,10 +17,10 @@ package server import ( + "context" "fmt" runtimespec "github.com/opencontainers/runtime-spec/specs-go" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" criconfig "github.com/containerd/containerd/pkg/cri/config" diff --git a/pkg/cri/server/events.go b/pkg/cri/server/events.go index b98dd1fd3..b94221031 100644 --- a/pkg/cri/server/events.go +++ b/pkg/cri/server/events.go @@ -17,6 +17,7 @@ package server import ( + "context" "errors" "fmt" "sync" @@ -34,7 +35,6 @@ import ( "github.com/containerd/typeurl" gogotypes "github.com/gogo/protobuf/types" "github.com/sirupsen/logrus" - "golang.org/x/net/context" "k8s.io/utils/clock" ) diff --git a/pkg/cri/server/helpers.go b/pkg/cri/server/helpers.go index abc66e389..aed38e05d 100644 --- a/pkg/cri/server/helpers.go +++ b/pkg/cri/server/helpers.go @@ -17,6 +17,7 @@ package server import ( + "context" "fmt" "path" "path/filepath" @@ -42,7 +43,6 @@ import ( runhcsoptions "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options" imagedigest "github.com/opencontainers/go-digest" "github.com/pelletier/go-toml" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/helpers_linux_test.go b/pkg/cri/server/helpers_linux_test.go index 23bba8d55..4a3433be0 100644 --- a/pkg/cri/server/helpers_linux_test.go +++ b/pkg/cri/server/helpers_linux_test.go @@ -17,13 +17,13 @@ package server import ( + "context" "os" "path/filepath" "testing" "time" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" "golang.org/x/sys/unix" ) diff --git a/pkg/cri/server/image_list.go b/pkg/cri/server/image_list.go index de4d1d02c..7f7fc1247 100644 --- a/pkg/cri/server/image_list.go +++ b/pkg/cri/server/image_list.go @@ -17,7 +17,8 @@ package server import ( - "golang.org/x/net/context" + "context" + runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/image_list_test.go b/pkg/cri/server/image_list_test.go index 09e4e0fad..b504defc3 100644 --- a/pkg/cri/server/image_list_test.go +++ b/pkg/cri/server/image_list_test.go @@ -17,12 +17,12 @@ package server import ( + "context" "testing" imagespec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" imagestore "github.com/containerd/containerd/pkg/cri/store/image" diff --git a/pkg/cri/server/image_pull.go b/pkg/cri/server/image_pull.go index 9d3e76d88..dd3eecab8 100644 --- a/pkg/cri/server/image_pull.go +++ b/pkg/cri/server/image_pull.go @@ -17,6 +17,7 @@ package server import ( + "context" "crypto/tls" "crypto/x509" "encoding/base64" @@ -40,7 +41,6 @@ import ( "github.com/containerd/imgcrypt" "github.com/containerd/imgcrypt/images/encryption" imagespec "github.com/opencontainers/image-spec/specs-go/v1" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" criconfig "github.com/containerd/containerd/pkg/cri/config" diff --git a/pkg/cri/server/image_remove.go b/pkg/cri/server/image_remove.go index 8821661b2..a963ae8bf 100644 --- a/pkg/cri/server/image_remove.go +++ b/pkg/cri/server/image_remove.go @@ -17,12 +17,12 @@ package server import ( + "context" "fmt" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/image_status.go b/pkg/cri/server/image_status.go index 5d28837f0..8ddba3e82 100644 --- a/pkg/cri/server/image_status.go +++ b/pkg/cri/server/image_status.go @@ -17,6 +17,7 @@ package server import ( + "context" "encoding/json" "fmt" @@ -25,7 +26,6 @@ import ( imagestore "github.com/containerd/containerd/pkg/cri/store/image" imagespec "github.com/opencontainers/image-spec/specs-go/v1" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/image_status_test.go b/pkg/cri/server/image_status_test.go index 49cd046ef..884f0f2e0 100644 --- a/pkg/cri/server/image_status_test.go +++ b/pkg/cri/server/image_status_test.go @@ -17,12 +17,12 @@ package server import ( + "context" "testing" imagespec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" imagestore "github.com/containerd/containerd/pkg/cri/store/image" diff --git a/pkg/cri/server/imagefs_info.go b/pkg/cri/server/imagefs_info.go index c91404d71..9b561ad57 100644 --- a/pkg/cri/server/imagefs_info.go +++ b/pkg/cri/server/imagefs_info.go @@ -17,10 +17,9 @@ package server import ( + "context" "time" - "golang.org/x/net/context" - runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/imagefs_info_test.go b/pkg/cri/server/imagefs_info_test.go index 782c86a0b..5845c7545 100644 --- a/pkg/cri/server/imagefs_info_test.go +++ b/pkg/cri/server/imagefs_info_test.go @@ -17,12 +17,12 @@ package server import ( + "context" "testing" snapshot "github.com/containerd/containerd/snapshots" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" snapshotstore "github.com/containerd/containerd/pkg/cri/store/snapshot" diff --git a/pkg/cri/server/instrumented_service.go b/pkg/cri/server/instrumented_service.go index 0b85d66f5..0623e5834 100644 --- a/pkg/cri/server/instrumented_service.go +++ b/pkg/cri/server/instrumented_service.go @@ -17,11 +17,11 @@ package server import ( + "context" "errors" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime_alpha "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" diff --git a/pkg/cri/server/restart.go b/pkg/cri/server/restart.go index f5f3e5083..ae63bab4b 100644 --- a/pkg/cri/server/restart.go +++ b/pkg/cri/server/restart.go @@ -17,6 +17,7 @@ package server import ( + "context" "fmt" "os" "path/filepath" @@ -30,7 +31,6 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/containerd/platforms" "github.com/containerd/typeurl" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" cio "github.com/containerd/containerd/pkg/cri/io" diff --git a/pkg/cri/server/sandbox_list.go b/pkg/cri/server/sandbox_list.go index b4f07221e..08ad80b7c 100644 --- a/pkg/cri/server/sandbox_list.go +++ b/pkg/cri/server/sandbox_list.go @@ -17,9 +17,9 @@ package server import ( + "context" "time" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" diff --git a/pkg/cri/server/sandbox_portforward.go b/pkg/cri/server/sandbox_portforward.go index 29ffb58c9..9a1aee43f 100644 --- a/pkg/cri/server/sandbox_portforward.go +++ b/pkg/cri/server/sandbox_portforward.go @@ -17,10 +17,10 @@ package server import ( + "context" "errors" "fmt" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" diff --git a/pkg/cri/server/sandbox_portforward_linux.go b/pkg/cri/server/sandbox_portforward_linux.go index 9f54daeac..7283b53c0 100644 --- a/pkg/cri/server/sandbox_portforward_linux.go +++ b/pkg/cri/server/sandbox_portforward_linux.go @@ -17,6 +17,7 @@ package server import ( + "context" "fmt" "io" "net" @@ -24,7 +25,6 @@ import ( "github.com/containerd/containerd/log" "github.com/containernetworking/plugins/pkg/ns" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/sandbox_portforward_other.go b/pkg/cri/server/sandbox_portforward_other.go index aa113405c..15d58a4d0 100644 --- a/pkg/cri/server/sandbox_portforward_other.go +++ b/pkg/cri/server/sandbox_portforward_other.go @@ -20,11 +20,11 @@ package server import ( + "context" "fmt" "io" "github.com/containerd/containerd/errdefs" - "golang.org/x/net/context" ) // portForward uses netns to enter the sandbox namespace, and forwards a stream inside the diff --git a/pkg/cri/server/sandbox_portforward_windows.go b/pkg/cri/server/sandbox_portforward_windows.go index d5bf77660..44442f678 100644 --- a/pkg/cri/server/sandbox_portforward_windows.go +++ b/pkg/cri/server/sandbox_portforward_windows.go @@ -18,10 +18,10 @@ package server import ( "bytes" + "context" "fmt" "io" - "golang.org/x/net/context" "k8s.io/utils/exec" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" diff --git a/pkg/cri/server/sandbox_remove.go b/pkg/cri/server/sandbox_remove.go index 4f5a4f78a..c479cf56f 100644 --- a/pkg/cri/server/sandbox_remove.go +++ b/pkg/cri/server/sandbox_remove.go @@ -17,6 +17,7 @@ package server import ( + "context" "fmt" "time" @@ -25,7 +26,6 @@ import ( "github.com/containerd/containerd/log" "github.com/sirupsen/logrus" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/sandbox_run.go b/pkg/cri/server/sandbox_run.go index 646df510a..f9aefaacf 100644 --- a/pkg/cri/server/sandbox_run.go +++ b/pkg/cri/server/sandbox_run.go @@ -17,6 +17,7 @@ package server import ( + "context" "encoding/json" "errors" "fmt" @@ -37,7 +38,6 @@ import ( "github.com/containerd/typeurl" "github.com/davecgh/go-spew/spew" "github.com/sirupsen/logrus" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "github.com/containerd/containerd/pkg/cri/annotations" diff --git a/pkg/cri/server/sandbox_run_test.go b/pkg/cri/server/sandbox_run_test.go index ea6e7851d..9c7e7b405 100644 --- a/pkg/cri/server/sandbox_run_test.go +++ b/pkg/cri/server/sandbox_run_test.go @@ -17,6 +17,7 @@ package server import ( + "context" "net" goruntime "runtime" "testing" @@ -26,7 +27,6 @@ import ( imagespec "github.com/opencontainers/image-spec/specs-go/v1" runtimespec "github.com/opencontainers/runtime-spec/specs-go" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "github.com/containerd/containerd/pkg/cri/annotations" diff --git a/pkg/cri/server/sandbox_stats.go b/pkg/cri/server/sandbox_stats.go index 8b4738836..d9c9a5550 100644 --- a/pkg/cri/server/sandbox_stats.go +++ b/pkg/cri/server/sandbox_stats.go @@ -17,9 +17,9 @@ package server import ( + "context" "fmt" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/sandbox_stats_linux.go b/pkg/cri/server/sandbox_stats_linux.go index bd06cb5a1..30dde85f1 100644 --- a/pkg/cri/server/sandbox_stats_linux.go +++ b/pkg/cri/server/sandbox_stats_linux.go @@ -17,11 +17,11 @@ package server import ( + "context" "fmt" "time" "github.com/containernetworking/plugins/pkg/ns" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "github.com/containerd/cgroups" diff --git a/pkg/cri/server/sandbox_stats_list.go b/pkg/cri/server/sandbox_stats_list.go index 01ded0e3c..ff55b8f1c 100644 --- a/pkg/cri/server/sandbox_stats_list.go +++ b/pkg/cri/server/sandbox_stats_list.go @@ -17,10 +17,10 @@ package server import ( + "context" "fmt" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/sandbox_stats_other.go b/pkg/cri/server/sandbox_stats_other.go index f21391eac..e99539903 100644 --- a/pkg/cri/server/sandbox_stats_other.go +++ b/pkg/cri/server/sandbox_stats_other.go @@ -20,9 +20,9 @@ package server import ( + "context" "fmt" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "github.com/containerd/containerd/errdefs" diff --git a/pkg/cri/server/sandbox_stats_windows.go b/pkg/cri/server/sandbox_stats_windows.go index d4b237337..ac8ab9e60 100644 --- a/pkg/cri/server/sandbox_stats_windows.go +++ b/pkg/cri/server/sandbox_stats_windows.go @@ -17,9 +17,9 @@ package server import ( + "context" "fmt" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "github.com/containerd/containerd/errdefs" diff --git a/pkg/cri/server/sandbox_status.go b/pkg/cri/server/sandbox_status.go index 609b559a8..6deb23ef5 100644 --- a/pkg/cri/server/sandbox_status.go +++ b/pkg/cri/server/sandbox_status.go @@ -17,6 +17,7 @@ package server import ( + "context" "encoding/json" "fmt" goruntime "runtime" @@ -25,7 +26,6 @@ import ( "github.com/containerd/containerd/errdefs" cni "github.com/containerd/go-cni" runtimespec "github.com/opencontainers/runtime-spec/specs-go" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" diff --git a/pkg/cri/server/sandbox_stop.go b/pkg/cri/server/sandbox_stop.go index a32316310..8e3044c9c 100644 --- a/pkg/cri/server/sandbox_stop.go +++ b/pkg/cri/server/sandbox_stop.go @@ -17,6 +17,7 @@ package server import ( + "context" "errors" "fmt" "syscall" @@ -25,7 +26,6 @@ import ( eventtypes "github.com/containerd/containerd/api/events" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" diff --git a/pkg/cri/server/sandbox_stop_test.go b/pkg/cri/server/sandbox_stop_test.go index 41b13217a..c0a20465c 100644 --- a/pkg/cri/server/sandbox_stop_test.go +++ b/pkg/cri/server/sandbox_stop_test.go @@ -17,11 +17,11 @@ package server import ( + "context" "testing" "time" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" ) diff --git a/pkg/cri/server/status.go b/pkg/cri/server/status.go index 704ff4f5e..7a702c57c 100644 --- a/pkg/cri/server/status.go +++ b/pkg/cri/server/status.go @@ -17,12 +17,12 @@ package server import ( + "context" "encoding/json" "fmt" goruntime "runtime" "github.com/containerd/containerd/log" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/update_runtime_config.go b/pkg/cri/server/update_runtime_config.go index 3cf0b5529..8f0a83ba7 100644 --- a/pkg/cri/server/update_runtime_config.go +++ b/pkg/cri/server/update_runtime_config.go @@ -17,6 +17,7 @@ package server import ( + "context" "fmt" "net" "os" @@ -25,7 +26,6 @@ import ( "text/template" "github.com/containerd/containerd/log" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/update_runtime_config_test.go b/pkg/cri/server/update_runtime_config_test.go index 852926685..d08571755 100644 --- a/pkg/cri/server/update_runtime_config_test.go +++ b/pkg/cri/server/update_runtime_config_test.go @@ -17,6 +17,7 @@ package server import ( + "context" "errors" "os" "path/filepath" @@ -24,7 +25,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" criconfig "github.com/containerd/containerd/pkg/cri/config" diff --git a/pkg/cri/server/version.go b/pkg/cri/server/version.go index 76d47f927..5e3091a35 100644 --- a/pkg/cri/server/version.go +++ b/pkg/cri/server/version.go @@ -17,8 +17,9 @@ package server import ( + "context" + "github.com/containerd/containerd/version" - "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime_alpha "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" diff --git a/pkg/cri/util/util.go b/pkg/cri/util/util.go index 22266ad58..ced3cfc93 100644 --- a/pkg/cri/util/util.go +++ b/pkg/cri/util/util.go @@ -17,10 +17,10 @@ package util import ( + "context" "time" "github.com/containerd/containerd/namespaces" - "golang.org/x/net/context" "github.com/containerd/containerd/pkg/cri/constants" ) diff --git a/remotes/docker/auth/fetch.go b/remotes/docker/auth/fetch.go index c259873d2..43c67f680 100644 --- a/remotes/docker/auth/fetch.go +++ b/remotes/docker/auth/fetch.go @@ -29,7 +29,6 @@ import ( "github.com/containerd/containerd/log" remoteserrors "github.com/containerd/containerd/remotes/errors" "github.com/containerd/containerd/version" - "golang.org/x/net/context/ctxhttp" ) var ( @@ -115,7 +114,7 @@ func FetchTokenWithOAuth(ctx context.Context, client *http.Client, headers http. form.Set("access_type", "offline") } - req, err := http.NewRequest("POST", to.Realm, strings.NewReader(form.Encode())) + req, err := http.NewRequestWithContext(ctx, "POST", to.Realm, strings.NewReader(form.Encode())) if err != nil { return nil, err } @@ -127,7 +126,7 @@ func FetchTokenWithOAuth(ctx context.Context, client *http.Client, headers http. req.Header.Set("User-Agent", "containerd/"+version.Version) } - resp, err := ctxhttp.Do(ctx, client, req) + resp, err := client.Do(req) if err != nil { return nil, err } @@ -162,7 +161,7 @@ type FetchTokenResponse struct { // FetchToken fetches a token using a GET request func FetchToken(ctx context.Context, client *http.Client, headers http.Header, to TokenOptions) (*FetchTokenResponse, error) { - req, err := http.NewRequest("GET", to.Realm, nil) + req, err := http.NewRequestWithContext(ctx, "GET", to.Realm, nil) if err != nil { return nil, err } @@ -194,7 +193,7 @@ func FetchToken(ctx context.Context, client *http.Client, headers http.Header, t req.URL.RawQuery = reqParams.Encode() - resp, err := ctxhttp.Do(ctx, client, req) + resp, err := client.Do(req) if err != nil { return nil, err } diff --git a/remotes/docker/resolver.go b/remotes/docker/resolver.go index 9bbbc2622..5feaee167 100644 --- a/remotes/docker/resolver.go +++ b/remotes/docker/resolver.go @@ -36,7 +36,6 @@ import ( digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" - "golang.org/x/net/context/ctxhttp" ) var ( @@ -524,7 +523,7 @@ type request struct { func (r *request) do(ctx context.Context) (*http.Response, error) { u := r.host.Scheme + "://" + r.host.Host + r.path - req, err := http.NewRequest(r.method, u, nil) + req, err := http.NewRequestWithContext(ctx, r.method, u, nil) if err != nil { return nil, err } @@ -566,7 +565,7 @@ func (r *request) do(ctx context.Context) (*http.Response, error) { } } - resp, err := ctxhttp.Do(ctx, client, req) + resp, err := client.Do(req) if err != nil { return nil, fmt.Errorf("failed to do request: %w", err) }