From 88c0c7201e2dd03be29edd49f7df39e19e1b440f Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Tue, 19 Apr 2022 02:15:34 +0000 Subject: [PATCH] Consolidate gogo/protobuf dependencies under our own protobuf package This would make gogo/protobuf migration easier. Signed-off-by: Kazuyoshi Kato --- client.go | 2 +- cmd/containerd-shim/main_unix.go | 2 +- cmd/containerd/command/publish.go | 2 +- cmd/ctr/commands/shim/shim.go | 2 +- container_restore_opts.go | 4 +-- containerstore.go | 2 +- content/proxy/content_store.go | 2 +- contrib/snapshotservice/service.go | 2 +- diff/diff.go | 2 +- diff/stream.go | 2 +- diff/stream_unix.go | 4 +-- diff/stream_windows.go | 4 +-- image_store.go | 2 +- integration/client/client_ttrpc_test.go | 2 +- integration/client/container_test.go | 2 +- integration/client/go.mod | 2 +- metadata/boltutil/helpers.go | 4 +-- metadata/containers.go | 4 +-- metadata/containers_test.go | 2 +- metadata/db_test.go | 2 +- metadata/namespaces_test.go | 2 +- metadata/sandbox_test.go | 2 +- metrics/cgroups/common/type.go | 2 +- metrics/cgroups/metrics_test.go | 2 +- namespaces.go | 2 +- pkg/cri/server/helpers_test.go | 2 +- pkg/process/deleted_state.go | 2 +- pkg/process/init.go | 2 +- pkg/process/init_state.go | 2 +- pkg/process/types.go | 2 +- protobuf/any.go | 6 ++-- protobuf/proto/proto.go | 30 +++++++++++++++++++ protobuf/types/types.go | 26 ++++++++++++++++ runtime/task.go | 2 +- runtime/v1/linux/runtime.go | 2 +- runtime/v1/linux/task.go | 2 +- runtime/v1/shim/client/client.go | 2 +- runtime/v1/shim/local.go | 2 +- runtime/v1/shim/service.go | 2 +- runtime/v2/binary.go | 2 +- runtime/v2/example/example.go | 2 +- runtime/v2/runc/manager/manager_linux.go | 4 +-- runtime/v2/runc/task/service.go | 2 +- runtime/v2/runc/v1/service.go | 4 +-- runtime/v2/shim.go | 2 +- runtime/v2/shim/shim.go | 2 +- runtime/v2/shim/util.go | 4 +-- sandbox.go | 2 +- sandbox/helpers.go | 2 +- services/containers/helpers.go | 2 +- services/containers/local.go | 2 +- services/containers/service.go | 2 +- .../content/contentserver/contentserver.go | 2 +- services/events/service.go | 2 +- services/events/ttrpc.go | 2 +- services/images/local.go | 2 +- services/images/service.go | 2 +- services/introspection/introspection.go | 2 +- services/introspection/local.go | 2 +- services/introspection/service.go | 2 +- services/leases/service.go | 2 +- services/namespaces/local.go | 2 +- services/namespaces/service.go | 2 +- services/snapshots/service.go | 2 +- services/tasks/local.go | 2 +- services/tasks/service.go | 2 +- services/version/service.go | 2 +- snapshots/proxy/proxy.go | 2 +- task.go | 2 +- 69 files changed, 133 insertions(+), 77 deletions(-) create mode 100644 protobuf/proto/proto.go create mode 100644 protobuf/types/types.go diff --git a/client.go b/client.go index defcc35f77d3..98b65daa4b80 100644 --- a/client.go +++ b/client.go @@ -53,6 +53,7 @@ import ( "github.com/containerd/containerd/pkg/dialer" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/plugin" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/sandbox" @@ -60,7 +61,6 @@ import ( "github.com/containerd/containerd/snapshots" snproxy "github.com/containerd/containerd/snapshots/proxy" "github.com/containerd/typeurl" - ptypes "github.com/gogo/protobuf/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/opencontainers/runtime-spec/specs-go" "golang.org/x/sync/semaphore" diff --git a/cmd/containerd-shim/main_unix.go b/cmd/containerd-shim/main_unix.go index bf30ce1a30f1..87b9f59e879a 100644 --- a/cmd/containerd-shim/main_unix.go +++ b/cmd/containerd-shim/main_unix.go @@ -39,13 +39,13 @@ import ( "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/process" "github.com/containerd/containerd/protobuf" + ptypes "github.com/containerd/containerd/protobuf/types" shimlog "github.com/containerd/containerd/runtime/v1" "github.com/containerd/containerd/runtime/v1/shim" shimapi "github.com/containerd/containerd/runtime/v1/shim/v1" "github.com/containerd/containerd/sys/reaper" "github.com/containerd/containerd/version" "github.com/containerd/ttrpc" - ptypes "github.com/gogo/protobuf/types" "github.com/sirupsen/logrus" exec "golang.org/x/sys/execabs" "golang.org/x/sys/unix" diff --git a/cmd/containerd/command/publish.go b/cmd/containerd/command/publish.go index b18f19f7e80a..9a67359b02a6 100644 --- a/cmd/containerd/command/publish.go +++ b/cmd/containerd/command/publish.go @@ -28,7 +28,7 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/dialer" - "github.com/gogo/protobuf/types" + "github.com/containerd/containerd/protobuf/types" "github.com/urfave/cli" "google.golang.org/grpc" "google.golang.org/grpc/backoff" diff --git a/cmd/ctr/commands/shim/shim.go b/cmd/ctr/commands/shim/shim.go index 36d75e338b36..d7063f0560f4 100644 --- a/cmd/ctr/commands/shim/shim.go +++ b/cmd/ctr/commands/shim/shim.go @@ -31,11 +31,11 @@ import ( "github.com/containerd/console" "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/namespaces" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/runtime/v2/shim" "github.com/containerd/containerd/runtime/v2/task" "github.com/containerd/ttrpc" "github.com/containerd/typeurl" - ptypes "github.com/gogo/protobuf/types" "github.com/opencontainers/runtime-spec/specs-go" "github.com/sirupsen/logrus" "github.com/urfave/cli" diff --git a/container_restore_opts.go b/container_restore_opts.go index bdc8650cda26..2afc18701386 100644 --- a/container_restore_opts.go +++ b/container_restore_opts.go @@ -24,8 +24,8 @@ import ( "github.com/containerd/containerd/containers" "github.com/containerd/containerd/content" "github.com/containerd/containerd/images" - "github.com/gogo/protobuf/proto" - ptypes "github.com/gogo/protobuf/types" + "github.com/containerd/containerd/protobuf/proto" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/opencontainers/image-spec/identity" imagespec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/containerstore.go b/containerstore.go index 82144cc9e2c6..20238603d965 100644 --- a/containerstore.go +++ b/containerstore.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd/containers" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/protobuf" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/typeurl" - ptypes "github.com/gogo/protobuf/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/content/proxy/content_store.go b/content/proxy/content_store.go index fd393aaa6402..2341579ae1bd 100644 --- a/content/proxy/content_store.go +++ b/content/proxy/content_store.go @@ -24,7 +24,7 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/protobuf" - protobuftypes "github.com/gogo/protobuf/types" + protobuftypes "github.com/containerd/containerd/protobuf/types" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/contrib/snapshotservice/service.go b/contrib/snapshotservice/service.go index af0f7be5969e..85cac01e2523 100644 --- a/contrib/snapshotservice/service.go +++ b/contrib/snapshotservice/service.go @@ -24,8 +24,8 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/protobuf" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/snapshots" - ptypes "github.com/gogo/protobuf/types" ) var empty = &ptypes.Empty{} diff --git a/diff/diff.go b/diff/diff.go index 235d6377c438..16a5054a9b14 100644 --- a/diff/diff.go +++ b/diff/diff.go @@ -21,7 +21,7 @@ import ( "io" "github.com/containerd/containerd/mount" - "github.com/gogo/protobuf/types" + "github.com/containerd/containerd/protobuf/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/diff/stream.go b/diff/stream.go index 44e35fcc8155..6a803c819101 100644 --- a/diff/stream.go +++ b/diff/stream.go @@ -24,7 +24,7 @@ import ( "github.com/containerd/containerd/archive/compression" "github.com/containerd/containerd/images" - "github.com/gogo/protobuf/types" + "github.com/containerd/containerd/protobuf/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/diff/stream_unix.go b/diff/stream_unix.go index 6622c331eea9..15da7279438b 100644 --- a/diff/stream_unix.go +++ b/diff/stream_unix.go @@ -28,8 +28,8 @@ import ( "os" "sync" - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/types" + "github.com/containerd/containerd/protobuf/proto" + "github.com/containerd/containerd/protobuf/types" exec "golang.org/x/sys/execabs" ) diff --git a/diff/stream_windows.go b/diff/stream_windows.go index c0bf03b94ab3..fe9c65233f2f 100644 --- a/diff/stream_windows.go +++ b/diff/stream_windows.go @@ -27,8 +27,8 @@ import ( "sync" winio "github.com/Microsoft/go-winio" - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/types" + "github.com/containerd/containerd/protobuf/proto" + "github.com/containerd/containerd/protobuf/types" "github.com/sirupsen/logrus" exec "golang.org/x/sys/execabs" ) diff --git a/image_store.go b/image_store.go index b1b1afcd19f5..b04fd9d68fb5 100644 --- a/image_store.go +++ b/image_store.go @@ -24,7 +24,7 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/protobuf" - ptypes "github.com/gogo/protobuf/types" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/integration/client/client_ttrpc_test.go b/integration/client/client_ttrpc_test.go index 235befb8922f..68714038c8a5 100644 --- a/integration/client/client_ttrpc_test.go +++ b/integration/client/client_ttrpc_test.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/ttrpcutil" "github.com/containerd/containerd/protobuf" + "github.com/containerd/containerd/protobuf/types" "github.com/containerd/ttrpc" - "github.com/gogo/protobuf/types" "github.com/stretchr/testify/assert" ) diff --git a/integration/client/container_test.go b/integration/client/container_test.go index aee9af90f5a6..aa6d07b8a4c3 100644 --- a/integration/client/container_test.go +++ b/integration/client/container_test.go @@ -40,11 +40,11 @@ import ( "github.com/containerd/containerd/oci" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/plugin" + gogotypes "github.com/containerd/containerd/protobuf/types" _ "github.com/containerd/containerd/runtime" "github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/go-runc" "github.com/containerd/typeurl" - gogotypes "github.com/gogo/protobuf/types" specs "github.com/opencontainers/runtime-spec/specs-go" exec "golang.org/x/sys/execabs" ) diff --git a/integration/client/go.mod b/integration/client/go.mod index c0e9bf354d54..723d4069c134 100644 --- a/integration/client/go.mod +++ b/integration/client/go.mod @@ -10,7 +10,7 @@ require ( github.com/containerd/go-runc v1.0.0 github.com/containerd/ttrpc v1.1.0 github.com/containerd/typeurl v1.0.3-0.20220324183432-6193a0e03259 - github.com/gogo/protobuf v1.3.2 + github.com/gogo/protobuf v1.3.2 // indirect github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.0.3-0.20220303224323-02efb9a75ee1 github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 diff --git a/metadata/boltutil/helpers.go b/metadata/boltutil/helpers.go index 73d546cedebb..c0d3ef4021ae 100644 --- a/metadata/boltutil/helpers.go +++ b/metadata/boltutil/helpers.go @@ -21,9 +21,9 @@ import ( "time" "github.com/containerd/containerd/protobuf" + "github.com/containerd/containerd/protobuf/proto" + "github.com/containerd/containerd/protobuf/types" "github.com/containerd/typeurl" - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/types" bolt "go.etcd.io/bbolt" ) diff --git a/metadata/containers.go b/metadata/containers.go index d6517ce47060..36ef0c4ae886 100644 --- a/metadata/containers.go +++ b/metadata/containers.go @@ -30,9 +30,9 @@ import ( "github.com/containerd/containerd/labels" "github.com/containerd/containerd/metadata/boltutil" "github.com/containerd/containerd/namespaces" + "github.com/containerd/containerd/protobuf/proto" + "github.com/containerd/containerd/protobuf/types" "github.com/containerd/typeurl" - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/types" bolt "go.etcd.io/bbolt" ) diff --git a/metadata/containers_test.go b/metadata/containers_test.go index 57c6293ddca3..6e3fa92bcdcb 100644 --- a/metadata/containers_test.go +++ b/metadata/containers_test.go @@ -31,8 +31,8 @@ import ( "github.com/containerd/containerd/log/logtest" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/protobuf" + "github.com/containerd/containerd/protobuf/types" "github.com/containerd/typeurl" - "github.com/gogo/protobuf/types" "github.com/google/go-cmp/cmp" "github.com/opencontainers/runtime-spec/specs-go" "github.com/stretchr/testify/assert" diff --git a/metadata/db_test.go b/metadata/db_test.go index 707d9a9f4a69..3708c96aa82f 100644 --- a/metadata/db_test.go +++ b/metadata/db_test.go @@ -38,9 +38,9 @@ import ( "github.com/containerd/containerd/leases" "github.com/containerd/containerd/log/logtest" "github.com/containerd/containerd/namespaces" + "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/native" - "github.com/gogo/protobuf/types" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" bolt "go.etcd.io/bbolt" diff --git a/metadata/namespaces_test.go b/metadata/namespaces_test.go index 31c1bd81fea5..6a64c69d0808 100644 --- a/metadata/namespaces_test.go +++ b/metadata/namespaces_test.go @@ -22,7 +22,7 @@ import ( "github.com/containerd/containerd/containers" "github.com/containerd/containerd/namespaces" - "github.com/gogo/protobuf/types" + "github.com/containerd/containerd/protobuf/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.etcd.io/bbolt" diff --git a/metadata/sandbox_test.go b/metadata/sandbox_test.go index 0147de78067b..e2576e9b8d03 100644 --- a/metadata/sandbox_test.go +++ b/metadata/sandbox_test.go @@ -22,9 +22,9 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/protobuf" + "github.com/containerd/containerd/protobuf/types" api "github.com/containerd/containerd/sandbox" "github.com/containerd/typeurl" - "github.com/gogo/protobuf/types" ) func TestSandboxCreate(t *testing.T) { diff --git a/metrics/cgroups/common/type.go b/metrics/cgroups/common/type.go index b192356503fc..98b4e64b61d4 100644 --- a/metrics/cgroups/common/type.go +++ b/metrics/cgroups/common/type.go @@ -22,7 +22,7 @@ package common import ( "context" - "github.com/gogo/protobuf/types" + "github.com/containerd/containerd/protobuf/types" ) // Statable type that returns cgroup metrics diff --git a/metrics/cgroups/metrics_test.go b/metrics/cgroups/metrics_test.go index c362ea3b9d65..24af264c324c 100644 --- a/metrics/cgroups/metrics_test.go +++ b/metrics/cgroups/metrics_test.go @@ -35,8 +35,8 @@ import ( "github.com/containerd/containerd/protobuf" "github.com/prometheus/client_golang/prometheus" + "github.com/containerd/containerd/protobuf/types" metrics "github.com/docker/go-metrics" - "github.com/gogo/protobuf/types" ) // TestRegressionIssue6772 should not have dead-lock when Collect and Add run diff --git a/namespaces.go b/namespaces.go index 4c66406b084e..ca0e468186e7 100644 --- a/namespaces.go +++ b/namespaces.go @@ -23,7 +23,7 @@ import ( api "github.com/containerd/containerd/api/services/namespaces/v1" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/namespaces" - "github.com/gogo/protobuf/types" + "github.com/containerd/containerd/protobuf/types" ) // NewNamespaceStoreFromClient returns a new namespace store diff --git a/pkg/cri/server/helpers_test.go b/pkg/cri/server/helpers_test.go index 8fa9af8c1767..0866d9840de8 100644 --- a/pkg/cri/server/helpers_test.go +++ b/pkg/cri/server/helpers_test.go @@ -30,11 +30,11 @@ import ( containerstore "github.com/containerd/containerd/pkg/cri/store/container" imagestore "github.com/containerd/containerd/pkg/cri/store/image" "github.com/containerd/containerd/plugin" + "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/reference/docker" "github.com/containerd/containerd/runtime/linux/runctypes" runcoptions "github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/typeurl" - "github.com/gogo/protobuf/types" imagedigest "github.com/opencontainers/go-digest" runtimespec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/process/deleted_state.go b/pkg/process/deleted_state.go index 4e62b300d08f..e1441623cdca 100644 --- a/pkg/process/deleted_state.go +++ b/pkg/process/deleted_state.go @@ -26,7 +26,7 @@ import ( "github.com/containerd/console" "github.com/containerd/containerd/errdefs" - google_protobuf "github.com/gogo/protobuf/types" + google_protobuf "github.com/containerd/containerd/protobuf/types" ) type deletedState struct { diff --git a/pkg/process/init.go b/pkg/process/init.go index 75eb0d187ed8..f25679c06fc8 100644 --- a/pkg/process/init.go +++ b/pkg/process/init.go @@ -34,9 +34,9 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/stdio" + google_protobuf "github.com/containerd/containerd/protobuf/types" "github.com/containerd/fifo" runc "github.com/containerd/go-runc" - google_protobuf "github.com/gogo/protobuf/types" specs "github.com/opencontainers/runtime-spec/specs-go" "golang.org/x/sys/unix" ) diff --git a/pkg/process/init_state.go b/pkg/process/init_state.go index 76c91492e6fc..09a17aeeb471 100644 --- a/pkg/process/init_state.go +++ b/pkg/process/init_state.go @@ -24,8 +24,8 @@ import ( "errors" "fmt" + google_protobuf "github.com/containerd/containerd/protobuf/types" runc "github.com/containerd/go-runc" - google_protobuf "github.com/gogo/protobuf/types" "github.com/sirupsen/logrus" ) diff --git a/pkg/process/types.go b/pkg/process/types.go index 03477038ab97..797b69f5f315 100644 --- a/pkg/process/types.go +++ b/pkg/process/types.go @@ -17,7 +17,7 @@ package process import ( - google_protobuf "github.com/gogo/protobuf/types" + google_protobuf "github.com/containerd/containerd/protobuf/types" ) // Mount holds filesystem mount configuration diff --git a/protobuf/any.go b/protobuf/any.go index 0f667176502e..f0f7b4e23fbd 100644 --- a/protobuf/any.go +++ b/protobuf/any.go @@ -17,11 +17,11 @@ package protobuf import ( + "github.com/containerd/containerd/protobuf/types" "github.com/containerd/typeurl" - "github.com/gogo/protobuf/types" ) -// FromAny converts typeurl.Any to github.com/gogo/protobuf/types.Any. +// FromAny converts typeurl.Any to github.com/containerd/containerd/protobuf/types.Any. func FromAny(from typeurl.Any) *types.Any { if from == nil { return nil @@ -37,7 +37,7 @@ func FromAny(from typeurl.Any) *types.Any { } } -// FromAny converts an arbitrary interface to github.com/gogo/protobuf/types.Any. +// FromAny converts an arbitrary interface to github.com/containerd/containerd/protobuf/types.Any. func MarshalAnyToProto(from interface{}) (*types.Any, error) { any, err := typeurl.MarshalAny(from) if err != nil { diff --git a/protobuf/proto/proto.go b/protobuf/proto/proto.go new file mode 100644 index 000000000000..6f5b75ccebff --- /dev/null +++ b/protobuf/proto/proto.go @@ -0,0 +1,30 @@ +/* + Copyright The containerd 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 proto provides convinient aliases that make google.golang.org/protobuf migration easier. +package proto + +import ( + gogo "github.com/gogo/protobuf/proto" +) + +func Marshal(input gogo.Message) ([]byte, error) { + return gogo.Marshal(input) +} + +func Unmarshal(input []byte, output gogo.Message) error { + return gogo.Unmarshal(input, output) +} diff --git a/protobuf/types/types.go b/protobuf/types/types.go new file mode 100644 index 000000000000..e668f123b8b8 --- /dev/null +++ b/protobuf/types/types.go @@ -0,0 +1,26 @@ +/* + Copyright The containerd 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 types provides convinient aliases that make google.golang.org/protobuf migration easier. +package types + +import ( + gogo "github.com/gogo/protobuf/types" +) + +type Empty = gogo.Empty +type Any = gogo.Any +type FieldMask = gogo.FieldMask diff --git a/runtime/task.go b/runtime/task.go index e453fa3a9903..6f9611cf29a0 100644 --- a/runtime/task.go +++ b/runtime/task.go @@ -20,7 +20,7 @@ import ( "context" "time" - "github.com/gogo/protobuf/types" + "github.com/containerd/containerd/protobuf/types" ) // TaskInfo provides task specific information diff --git a/runtime/v1/linux/runtime.go b/runtime/v1/linux/runtime.go index 8d671bdc5a9c..f4b7be161015 100644 --- a/runtime/v1/linux/runtime.go +++ b/runtime/v1/linux/runtime.go @@ -42,13 +42,13 @@ import ( "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/protobuf" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/runtime" "github.com/containerd/containerd/runtime/linux/runctypes" v1 "github.com/containerd/containerd/runtime/v1" "github.com/containerd/containerd/runtime/v1/shim/v1" "github.com/containerd/go-runc" "github.com/containerd/typeurl" - ptypes "github.com/gogo/protobuf/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" diff --git a/runtime/v1/linux/task.go b/runtime/v1/linux/task.go index 3c8f4ea6950f..c2fbc8b2af25 100644 --- a/runtime/v1/linux/task.go +++ b/runtime/v1/linux/task.go @@ -32,11 +32,11 @@ import ( "github.com/containerd/containerd/identifiers" "github.com/containerd/containerd/log" "github.com/containerd/containerd/protobuf" + "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/runtime" "github.com/containerd/containerd/runtime/v1/shim/client" "github.com/containerd/containerd/runtime/v1/shim/v1" "github.com/containerd/ttrpc" - "github.com/gogo/protobuf/types" ) // Task on a linux based system diff --git a/runtime/v1/shim/client/client.go b/runtime/v1/shim/client/client.go index 83b6717c8392..72aa073b99f7 100644 --- a/runtime/v1/shim/client/client.go +++ b/runtime/v1/shim/client/client.go @@ -35,12 +35,12 @@ import ( "github.com/containerd/containerd/events" "github.com/containerd/containerd/log" + ptypes "github.com/containerd/containerd/protobuf/types" v1 "github.com/containerd/containerd/runtime/v1" "github.com/containerd/containerd/runtime/v1/shim" shimapi "github.com/containerd/containerd/runtime/v1/shim/v1" "github.com/containerd/containerd/sys" "github.com/containerd/ttrpc" - ptypes "github.com/gogo/protobuf/types" "github.com/sirupsen/logrus" exec "golang.org/x/sys/execabs" "golang.org/x/sys/unix" diff --git a/runtime/v1/shim/local.go b/runtime/v1/shim/local.go index f9a271e09471..cd6fa4ff7257 100644 --- a/runtime/v1/shim/local.go +++ b/runtime/v1/shim/local.go @@ -24,8 +24,8 @@ import ( "path/filepath" "github.com/containerd/containerd/mount" + ptypes "github.com/containerd/containerd/protobuf/types" shimapi "github.com/containerd/containerd/runtime/v1/shim/v1" - ptypes "github.com/gogo/protobuf/types" ) // NewLocal returns a shim client implementation for issue commands to a shim diff --git a/runtime/v1/shim/service.go b/runtime/v1/shim/service.go index fff1e04190c5..81ecf0773cc4 100644 --- a/runtime/v1/shim/service.go +++ b/runtime/v1/shim/service.go @@ -38,13 +38,13 @@ import ( "github.com/containerd/containerd/pkg/process" "github.com/containerd/containerd/pkg/stdio" "github.com/containerd/containerd/protobuf" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/runtime" "github.com/containerd/containerd/runtime/linux/runctypes" shimapi "github.com/containerd/containerd/runtime/v1/shim/v1" "github.com/containerd/containerd/sys/reaper" runc "github.com/containerd/go-runc" "github.com/containerd/typeurl" - ptypes "github.com/gogo/protobuf/types" specs "github.com/opencontainers/runtime-spec/specs-go" "github.com/sirupsen/logrus" "google.golang.org/grpc/codes" diff --git a/runtime/v2/binary.go b/runtime/v2/binary.go index ef97b8ed6400..104e31ad8cb9 100644 --- a/runtime/v2/binary.go +++ b/runtime/v2/binary.go @@ -29,11 +29,11 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/protobuf" + "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/runtime" client "github.com/containerd/containerd/runtime/v2/shim" "github.com/containerd/containerd/runtime/v2/task" "github.com/containerd/ttrpc" - "github.com/gogo/protobuf/types" "github.com/sirupsen/logrus" ) diff --git a/runtime/v2/example/example.go b/runtime/v2/example/example.go index 85ce9302ee8c..bffec24a8b85 100644 --- a/runtime/v2/example/example.go +++ b/runtime/v2/example/example.go @@ -24,9 +24,9 @@ import ( "os" "github.com/containerd/containerd/errdefs" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/runtime/v2/shim" taskAPI "github.com/containerd/containerd/runtime/v2/task" - ptypes "github.com/gogo/protobuf/types" ) var ( diff --git a/runtime/v2/runc/manager/manager_linux.go b/runtime/v2/runc/manager/manager_linux.go index 3a7c5be67843..bbcbf645d8af 100644 --- a/runtime/v2/runc/manager/manager_linux.go +++ b/runtime/v2/runc/manager/manager_linux.go @@ -34,13 +34,13 @@ import ( "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/process" "github.com/containerd/containerd/pkg/schedcore" + "github.com/containerd/containerd/protobuf/proto" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/runtime/v2/runc" "github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/containerd/runtime/v2/shim" runcC "github.com/containerd/go-runc" "github.com/containerd/typeurl" - "github.com/gogo/protobuf/proto" - ptypes "github.com/gogo/protobuf/types" exec "golang.org/x/sys/execabs" "golang.org/x/sys/unix" ) diff --git a/runtime/v2/runc/task/service.go b/runtime/v2/runc/task/service.go index 8d701fedf643..11adef04ea40 100644 --- a/runtime/v2/runc/task/service.go +++ b/runtime/v2/runc/task/service.go @@ -39,6 +39,7 @@ import ( "github.com/containerd/containerd/pkg/stdio" "github.com/containerd/containerd/pkg/userns" "github.com/containerd/containerd/protobuf" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/runtime/v2/runc" "github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/containerd/runtime/v2/shim" @@ -48,7 +49,6 @@ import ( runcC "github.com/containerd/go-runc" "github.com/containerd/ttrpc" "github.com/containerd/typeurl" - ptypes "github.com/gogo/protobuf/types" "github.com/sirupsen/logrus" ) diff --git a/runtime/v2/runc/v1/service.go b/runtime/v2/runc/v1/service.go index e17754f3023c..6f01c857ba4f 100644 --- a/runtime/v2/runc/v1/service.go +++ b/runtime/v2/runc/v1/service.go @@ -42,6 +42,8 @@ import ( "github.com/containerd/containerd/pkg/schedcore" "github.com/containerd/containerd/pkg/stdio" "github.com/containerd/containerd/protobuf" + "github.com/containerd/containerd/protobuf/proto" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/runtime/v2/runc" "github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/containerd/runtime/v2/shim" @@ -49,8 +51,6 @@ import ( "github.com/containerd/containerd/sys/reaper" runcC "github.com/containerd/go-runc" "github.com/containerd/typeurl" - "github.com/gogo/protobuf/proto" - ptypes "github.com/gogo/protobuf/types" "github.com/sirupsen/logrus" exec "golang.org/x/sys/execabs" "golang.org/x/sys/unix" diff --git a/runtime/v2/shim.go b/runtime/v2/shim.go index 2ddf15a8a03a..8c8f7e8c5664 100644 --- a/runtime/v2/shim.go +++ b/runtime/v2/shim.go @@ -34,11 +34,11 @@ import ( "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/timeout" "github.com/containerd/containerd/protobuf" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/runtime" client "github.com/containerd/containerd/runtime/v2/shim" "github.com/containerd/containerd/runtime/v2/task" "github.com/containerd/ttrpc" - ptypes "github.com/gogo/protobuf/types" "github.com/hashicorp/go-multierror" "github.com/sirupsen/logrus" ) diff --git a/runtime/v2/shim/shim.go b/runtime/v2/shim/shim.go index 8e3cc4364e99..5378c15fba69 100644 --- a/runtime/v2/shim/shim.go +++ b/runtime/v2/shim/shim.go @@ -35,10 +35,10 @@ import ( "github.com/containerd/containerd/pkg/shutdown" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/protobuf" + "github.com/containerd/containerd/protobuf/proto" shimapi "github.com/containerd/containerd/runtime/v2/task" "github.com/containerd/containerd/version" "github.com/containerd/ttrpc" - "github.com/gogo/protobuf/proto" "github.com/sirupsen/logrus" ) diff --git a/runtime/v2/shim/util.go b/runtime/v2/shim/util.go index a90d004bb628..bf78fa58f563 100644 --- a/runtime/v2/shim/util.go +++ b/runtime/v2/shim/util.go @@ -28,8 +28,8 @@ import ( "time" "github.com/containerd/containerd/namespaces" - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/types" + "github.com/containerd/containerd/protobuf/proto" + "github.com/containerd/containerd/protobuf/types" exec "golang.org/x/sys/execabs" ) diff --git a/sandbox.go b/sandbox.go index ca55bc868063..6c4827b2ae4f 100644 --- a/sandbox.go +++ b/sandbox.go @@ -24,9 +24,9 @@ import ( "github.com/containerd/containerd/containers" "github.com/containerd/containerd/oci" "github.com/containerd/containerd/protobuf" + "github.com/containerd/containerd/protobuf/types" api "github.com/containerd/containerd/sandbox" "github.com/containerd/typeurl" - "github.com/gogo/protobuf/types" "github.com/pkg/errors" ) diff --git a/sandbox/helpers.go b/sandbox/helpers.go index 69288aa4b932..08e4f48b406c 100644 --- a/sandbox/helpers.go +++ b/sandbox/helpers.go @@ -19,8 +19,8 @@ package sandbox import ( "github.com/containerd/containerd/api/types" "github.com/containerd/containerd/protobuf" + gogo_types "github.com/containerd/containerd/protobuf/types" "github.com/containerd/typeurl" - gogo_types "github.com/gogo/protobuf/types" ) // ToProto will map Sandbox struct to it's protobuf definition diff --git a/services/containers/helpers.go b/services/containers/helpers.go index bdb6a6dcc59e..4dc166e34969 100644 --- a/services/containers/helpers.go +++ b/services/containers/helpers.go @@ -20,8 +20,8 @@ import ( api "github.com/containerd/containerd/api/services/containers/v1" "github.com/containerd/containerd/containers" "github.com/containerd/containerd/protobuf" + "github.com/containerd/containerd/protobuf/types" "github.com/containerd/typeurl" - "github.com/gogo/protobuf/types" ) func containersToProto(containers []containers.Container) []api.Container { diff --git a/services/containers/local.go b/services/containers/local.go index 843512e0e98a..a525d015d608 100644 --- a/services/containers/local.go +++ b/services/containers/local.go @@ -27,8 +27,8 @@ import ( "github.com/containerd/containerd/events" "github.com/containerd/containerd/metadata" "github.com/containerd/containerd/plugin" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/services" - ptypes "github.com/gogo/protobuf/types" bolt "go.etcd.io/bbolt" "google.golang.org/grpc" "google.golang.org/grpc/codes" diff --git a/services/containers/service.go b/services/containers/service.go index a8bfd96a6c04..ac58eb1ea441 100644 --- a/services/containers/service.go +++ b/services/containers/service.go @@ -23,8 +23,8 @@ import ( api "github.com/containerd/containerd/api/services/containers/v1" "github.com/containerd/containerd/plugin" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/services" - ptypes "github.com/gogo/protobuf/types" "google.golang.org/grpc" ) diff --git a/services/content/contentserver/contentserver.go b/services/content/contentserver/contentserver.go index 17685854a9d5..bfb57a1c66a5 100644 --- a/services/content/contentserver/contentserver.go +++ b/services/content/contentserver/contentserver.go @@ -27,7 +27,7 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" "github.com/containerd/containerd/protobuf" - ptypes "github.com/gogo/protobuf/types" + ptypes "github.com/containerd/containerd/protobuf/types" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" diff --git a/services/events/service.go b/services/events/service.go index 7ab0dfa9b0c0..3027647001a1 100644 --- a/services/events/service.go +++ b/services/events/service.go @@ -27,8 +27,8 @@ import ( "github.com/containerd/containerd/events/exchange" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/protobuf" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/ttrpc" - ptypes "github.com/gogo/protobuf/types" "google.golang.org/grpc" ) diff --git a/services/events/ttrpc.go b/services/events/ttrpc.go index 20e5ba05b455..1b3ceb9432aa 100644 --- a/services/events/ttrpc.go +++ b/services/events/ttrpc.go @@ -24,7 +24,7 @@ import ( "github.com/containerd/containerd/events" "github.com/containerd/containerd/events/exchange" "github.com/containerd/containerd/protobuf" - ptypes "github.com/gogo/protobuf/types" + ptypes "github.com/containerd/containerd/protobuf/types" ) type ttrpcService struct { diff --git a/services/images/local.go b/services/images/local.go index ddd815a191f9..bed01f8960bb 100644 --- a/services/images/local.go +++ b/services/images/local.go @@ -28,8 +28,8 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/containerd/metadata" "github.com/containerd/containerd/plugin" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/services" - ptypes "github.com/gogo/protobuf/types" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/services/images/service.go b/services/images/service.go index fbfa7495336b..86502dfec313 100644 --- a/services/images/service.go +++ b/services/images/service.go @@ -22,8 +22,8 @@ import ( imagesapi "github.com/containerd/containerd/api/services/images/v1" "github.com/containerd/containerd/plugin" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/services" - ptypes "github.com/gogo/protobuf/types" "google.golang.org/grpc" ) diff --git a/services/introspection/introspection.go b/services/introspection/introspection.go index 71758fad88b8..8b25cd5975ad 100644 --- a/services/introspection/introspection.go +++ b/services/introspection/introspection.go @@ -22,7 +22,7 @@ import ( api "github.com/containerd/containerd/api/services/introspection/v1" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" - ptypes "github.com/gogo/protobuf/types" + ptypes "github.com/containerd/containerd/protobuf/types" ) // Service defines the instrospection service interface diff --git a/services/introspection/local.go b/services/introspection/local.go index 47388e4371c0..e15da7f86e2b 100644 --- a/services/introspection/local.go +++ b/services/introspection/local.go @@ -27,9 +27,9 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/plugin" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/services" "github.com/gogo/googleapis/google/rpc" - ptypes "github.com/gogo/protobuf/types" "github.com/google/uuid" "google.golang.org/grpc" "google.golang.org/grpc/status" diff --git a/services/introspection/service.go b/services/introspection/service.go index c11b8dc1ce3e..33617b7b922b 100644 --- a/services/introspection/service.go +++ b/services/introspection/service.go @@ -22,8 +22,8 @@ import ( api "github.com/containerd/containerd/api/services/introspection/v1" "github.com/containerd/containerd/plugin" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/services" - ptypes "github.com/gogo/protobuf/types" "google.golang.org/grpc" ) diff --git a/services/leases/service.go b/services/leases/service.go index 32589e49c740..07c255d1c9db 100644 --- a/services/leases/service.go +++ b/services/leases/service.go @@ -24,7 +24,7 @@ import ( "github.com/containerd/containerd/leases" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/protobuf" - ptypes "github.com/gogo/protobuf/types" + ptypes "github.com/containerd/containerd/protobuf/types" "google.golang.org/grpc" ) diff --git a/services/namespaces/local.go b/services/namespaces/local.go index c45ae807426c..06d6d5c85113 100644 --- a/services/namespaces/local.go +++ b/services/namespaces/local.go @@ -27,8 +27,8 @@ import ( "github.com/containerd/containerd/metadata" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/plugin" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/services" - ptypes "github.com/gogo/protobuf/types" bolt "go.etcd.io/bbolt" "google.golang.org/grpc" "google.golang.org/grpc/codes" diff --git a/services/namespaces/service.go b/services/namespaces/service.go index 27d977531a8e..22a501c3ee45 100644 --- a/services/namespaces/service.go +++ b/services/namespaces/service.go @@ -22,8 +22,8 @@ import ( api "github.com/containerd/containerd/api/services/namespaces/v1" "github.com/containerd/containerd/plugin" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/services" - ptypes "github.com/gogo/protobuf/types" "google.golang.org/grpc" ) diff --git a/services/snapshots/service.go b/services/snapshots/service.go index 49e17f685e52..2a83d2121b48 100644 --- a/services/snapshots/service.go +++ b/services/snapshots/service.go @@ -27,9 +27,9 @@ import ( "github.com/containerd/containerd/mount" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/protobuf" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/services" "github.com/containerd/containerd/snapshots" - ptypes "github.com/gogo/protobuf/types" "google.golang.org/grpc" ) diff --git a/services/tasks/local.go b/services/tasks/local.go index b5aadb8894c7..b39cf16c70ee 100644 --- a/services/tasks/local.go +++ b/services/tasks/local.go @@ -42,12 +42,12 @@ import ( "github.com/containerd/containerd/pkg/timeout" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/protobuf" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/runtime" "github.com/containerd/containerd/runtime/linux/runctypes" "github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/containerd/services" "github.com/containerd/typeurl" - ptypes "github.com/gogo/protobuf/types" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "google.golang.org/grpc" diff --git a/services/tasks/service.go b/services/tasks/service.go index f73ffb415714..fb89a95fc0b1 100644 --- a/services/tasks/service.go +++ b/services/tasks/service.go @@ -22,8 +22,8 @@ import ( api "github.com/containerd/containerd/api/services/tasks/v1" "github.com/containerd/containerd/plugin" + ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/services" - ptypes "github.com/gogo/protobuf/types" "google.golang.org/grpc" ) diff --git a/services/version/service.go b/services/version/service.go index aaa5d25a7755..d388070f1b51 100644 --- a/services/version/service.go +++ b/services/version/service.go @@ -21,8 +21,8 @@ import ( api "github.com/containerd/containerd/api/services/version/v1" "github.com/containerd/containerd/plugin" + ptypes "github.com/containerd/containerd/protobuf/types" ctrdversion "github.com/containerd/containerd/version" - ptypes "github.com/gogo/protobuf/types" "google.golang.org/grpc" ) diff --git a/snapshots/proxy/proxy.go b/snapshots/proxy/proxy.go index d9b2a054def0..3a6f113e180e 100644 --- a/snapshots/proxy/proxy.go +++ b/snapshots/proxy/proxy.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/protobuf" + protobuftypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/snapshots" - protobuftypes "github.com/gogo/protobuf/types" ) // NewSnapshotter returns a new Snapshotter which communicates over a GRPC diff --git a/task.go b/task.go index f600bd88fe63..a6e713cc6ba3 100644 --- a/task.go +++ b/task.go @@ -39,11 +39,11 @@ import ( "github.com/containerd/containerd/oci" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/protobuf" + google_protobuf "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/rootfs" "github.com/containerd/containerd/runtime/linux/runctypes" "github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/typeurl" - google_protobuf "github.com/gogo/protobuf/types" digest "github.com/opencontainers/go-digest" is "github.com/opencontainers/image-spec/specs-go" v1 "github.com/opencontainers/image-spec/specs-go/v1"