api: use weak imports for plugin protobufs
Because of a side-effect import, we have the possibility of pulling in several unnecessary packages that are used by the plugin and not at runtime to implement protobuf structures. Setting these imports to `weak` prevents this from happening, reducing the total import set, reducing memory usage and binary size. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
@@ -52,8 +52,8 @@ file {
|
||||
file {
|
||||
name: "github.com/containerd/containerd/api/events/container.proto"
|
||||
package: "containerd.events"
|
||||
dependency: "gogoproto/gogo.proto"
|
||||
dependency: "google/protobuf/any.proto"
|
||||
dependency: "gogoproto/gogo.proto"
|
||||
dependency: "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto"
|
||||
message_type {
|
||||
name: "ContainerCreate"
|
||||
@@ -164,6 +164,8 @@ file {
|
||||
go_package: "github.com/containerd/containerd/api/events;events"
|
||||
63300: 1
|
||||
}
|
||||
weak_dependency: 1
|
||||
weak_dependency: 2
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -189,6 +191,8 @@ file {
|
||||
go_package: "github.com/containerd/containerd/api/events;events"
|
||||
63300: 1
|
||||
}
|
||||
weak_dependency: 0
|
||||
weak_dependency: 1
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -285,6 +289,7 @@ file {
|
||||
go_package: "github.com/containerd/containerd/api/events;events"
|
||||
63300: 1
|
||||
}
|
||||
weak_dependency: 0
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -382,6 +387,8 @@ file {
|
||||
go_package: "github.com/containerd/containerd/api/events;events"
|
||||
63300: 1
|
||||
}
|
||||
weak_dependency: 0
|
||||
weak_dependency: 1
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -436,6 +443,7 @@ file {
|
||||
go_package: "github.com/containerd/containerd/api/events;events"
|
||||
63300: 1
|
||||
}
|
||||
weak_dependency: 0
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -507,6 +515,7 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/types;types"
|
||||
}
|
||||
weak_dependency: 0
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -785,6 +794,8 @@ file {
|
||||
go_package: "github.com/containerd/containerd/api/events;events"
|
||||
63300: 1
|
||||
}
|
||||
weak_dependency: 0
|
||||
weak_dependency: 3
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -1137,6 +1148,7 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/services/containers/v1;containers"
|
||||
}
|
||||
weak_dependency: 0
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -1701,6 +1713,7 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/services/content/v1;content"
|
||||
}
|
||||
weak_dependency: 0
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -1738,6 +1751,7 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/types;types"
|
||||
}
|
||||
weak_dependency: 0
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -1864,6 +1878,7 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/services/diff/v1;diff"
|
||||
}
|
||||
weak_dependency: 0
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -1975,6 +1990,8 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/services/events/v1;events"
|
||||
}
|
||||
weak_dependency: 0
|
||||
weak_dependency: 1
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -2208,6 +2225,7 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/services/images/v1;images"
|
||||
}
|
||||
weak_dependency: 0
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -2244,6 +2262,7 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/types;types"
|
||||
}
|
||||
weak_dependency: 0
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -2403,6 +2422,7 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/services/introspection/v1;introspection"
|
||||
}
|
||||
weak_dependency: 2
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -2562,6 +2582,7 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/services/leases/v1;leases"
|
||||
}
|
||||
weak_dependency: 0
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -2761,6 +2782,7 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/services/namespaces/v1;namespaces"
|
||||
}
|
||||
weak_dependency: 0
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -3290,6 +3312,7 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/services/snapshot/v1;snapshot"
|
||||
}
|
||||
weak_dependency: 0
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -3331,6 +3354,7 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/types;types"
|
||||
}
|
||||
weak_dependency: 0
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -3485,6 +3509,7 @@ file {
|
||||
62023: "Status"
|
||||
}
|
||||
}
|
||||
weak_dependency: 0
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -4108,6 +4133,7 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/services/tasks/v1;tasks"
|
||||
}
|
||||
weak_dependency: 2
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
@@ -4143,5 +4169,6 @@ file {
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/services/version/v1;version"
|
||||
}
|
||||
weak_dependency: 1
|
||||
syntax: "proto3"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user