diff --git a/cli/cmd/serve.go b/cli/cmd/serve.go index e2ba148ac..dcdde89db 100644 --- a/cli/cmd/serve.go +++ b/cli/cmd/serve.go @@ -24,12 +24,12 @@ import ( "github.com/spf13/cobra" "github.com/docker/compose-cli/cli/server" + composev1 "github.com/docker/compose-cli/cli/server/protos/compose/v1" + containersv1 "github.com/docker/compose-cli/cli/server/protos/containers/v1" + contextsv1 "github.com/docker/compose-cli/cli/server/protos/contexts/v1" + streamsv1 "github.com/docker/compose-cli/cli/server/protos/streams/v1" + volumesv1 "github.com/docker/compose-cli/cli/server/protos/volumes/v1" "github.com/docker/compose-cli/cli/server/proxy" - composev1 "github.com/docker/compose-cli/protos/compose/v1" - containersv1 "github.com/docker/compose-cli/protos/containers/v1" - contextsv1 "github.com/docker/compose-cli/protos/contexts/v1" - streamsv1 "github.com/docker/compose-cli/protos/streams/v1" - volumesv1 "github.com/docker/compose-cli/protos/volumes/v1" ) type serveOpts struct { diff --git a/cli/server/metrics_test.go b/cli/server/metrics_test.go index 87ec5abaa..a3f81e1e5 100644 --- a/cli/server/metrics_test.go +++ b/cli/server/metrics_test.go @@ -34,13 +34,13 @@ import ( "github.com/docker/compose-cli/api/secrets" "github.com/docker/compose-cli/api/volumes" "github.com/docker/compose-cli/cli/metrics" + composev1 "github.com/docker/compose-cli/cli/server/protos/compose/v1" + containersv1 "github.com/docker/compose-cli/cli/server/protos/containers/v1" + contextsv1 "github.com/docker/compose-cli/cli/server/protos/contexts/v1" + streamsv1 "github.com/docker/compose-cli/cli/server/protos/streams/v1" + volumesv1 "github.com/docker/compose-cli/cli/server/protos/volumes/v1" "github.com/docker/compose-cli/cli/server/proxy" "github.com/docker/compose-cli/errdefs" - composev1 "github.com/docker/compose-cli/protos/compose/v1" - containersv1 "github.com/docker/compose-cli/protos/containers/v1" - contextsv1 "github.com/docker/compose-cli/protos/contexts/v1" - streamsv1 "github.com/docker/compose-cli/protos/streams/v1" - volumesv1 "github.com/docker/compose-cli/protos/volumes/v1" ) func TestAllMethodsHaveCorrespondingCliCommand(t *testing.T) { diff --git a/protos/compose/v1/compose.pb.go b/cli/server/protos/compose/v1/compose.pb.go similarity index 100% rename from protos/compose/v1/compose.pb.go rename to cli/server/protos/compose/v1/compose.pb.go diff --git a/protos/compose/v1/compose.proto b/cli/server/protos/compose/v1/compose.proto similarity index 95% rename from protos/compose/v1/compose.proto rename to cli/server/protos/compose/v1/compose.proto index 216a905e1..2858af163 100644 --- a/protos/compose/v1/compose.proto +++ b/cli/server/protos/compose/v1/compose.proto @@ -17,7 +17,7 @@ syntax = "proto3"; package com.docker.api.protos.compose.v1; -option go_package = "github.com/docker/compose-cli/protos/compose/v1;v1"; +option go_package = "github.com/docker/compose-cli/cli/server/protos/compose/v1;v1"; service Compose { rpc Up(ComposeUpRequest) returns (ComposeUpResponse); diff --git a/protos/compose/v1/doc.go b/cli/server/protos/compose/v1/doc.go similarity index 100% rename from protos/compose/v1/doc.go rename to cli/server/protos/compose/v1/doc.go diff --git a/protos/containers/v1/containers.pb.go b/cli/server/protos/containers/v1/containers.pb.go similarity index 100% rename from protos/containers/v1/containers.pb.go rename to cli/server/protos/containers/v1/containers.pb.go diff --git a/protos/containers/v1/containers.proto b/cli/server/protos/containers/v1/containers.proto similarity index 97% rename from protos/containers/v1/containers.proto rename to cli/server/protos/containers/v1/containers.proto index 647b58b3b..86ea30fb6 100644 --- a/protos/containers/v1/containers.proto +++ b/cli/server/protos/containers/v1/containers.proto @@ -17,7 +17,7 @@ syntax = "proto3"; package com.docker.api.protos.containers.v1; -option go_package = "github.com/docker/compose-cli/protos/containers/v1;v1"; +option go_package = "github.com/docker/compose-cli/cli/server/protos/containers/v1;v1"; service Containers { rpc List(ListRequest) returns (ListResponse); diff --git a/protos/containers/v1/doc.go b/cli/server/protos/containers/v1/doc.go similarity index 100% rename from protos/containers/v1/doc.go rename to cli/server/protos/containers/v1/doc.go diff --git a/protos/contexts/v1/contexts.pb.go b/cli/server/protos/contexts/v1/contexts.pb.go similarity index 100% rename from protos/contexts/v1/contexts.pb.go rename to cli/server/protos/contexts/v1/contexts.pb.go diff --git a/protos/contexts/v1/contexts.proto b/cli/server/protos/contexts/v1/contexts.proto similarity index 94% rename from protos/contexts/v1/contexts.proto rename to cli/server/protos/contexts/v1/contexts.proto index 2c4755cdd..a77239cac 100644 --- a/protos/contexts/v1/contexts.proto +++ b/cli/server/protos/contexts/v1/contexts.proto @@ -17,7 +17,7 @@ syntax = "proto3"; package com.docker.api.protos.context.v1; -option go_package = "github.com/docker/compose-cli/protos/context/v1;v1"; +option go_package = "github.com/docker/compose-cli/cli/server/protos/context/v1;v1"; service Contexts { // Sets the current request for all calls diff --git a/protos/contexts/v1/doc.go b/cli/server/protos/contexts/v1/doc.go similarity index 100% rename from protos/contexts/v1/doc.go rename to cli/server/protos/contexts/v1/doc.go diff --git a/protos/streams/v1/streams.pb.go b/cli/server/protos/streams/v1/streams.pb.go similarity index 100% rename from protos/streams/v1/streams.pb.go rename to cli/server/protos/streams/v1/streams.pb.go diff --git a/protos/streams/v1/streams.proto b/cli/server/protos/streams/v1/streams.proto similarity index 92% rename from protos/streams/v1/streams.proto rename to cli/server/protos/streams/v1/streams.proto index 8d3961188..cde5b3d3c 100644 --- a/protos/streams/v1/streams.proto +++ b/cli/server/protos/streams/v1/streams.proto @@ -19,7 +19,7 @@ package com.docker.api.protos.streams.v1; import "google/protobuf/any.proto"; -option go_package = "github.com/docker/compose-cli/protos/streams/v1;v1"; +option go_package = "github.com/docker/compose-cli/cli/server/protos/streams/v1;v1"; service Streaming { rpc NewStream(stream google.protobuf.Any) returns (stream google.protobuf.Any); diff --git a/protos/volumes/v1/volumes.pb.go b/cli/server/protos/volumes/v1/volumes.pb.go similarity index 100% rename from protos/volumes/v1/volumes.pb.go rename to cli/server/protos/volumes/v1/volumes.pb.go diff --git a/protos/volumes/v1/volumes.proto b/cli/server/protos/volumes/v1/volumes.proto similarity index 94% rename from protos/volumes/v1/volumes.proto rename to cli/server/protos/volumes/v1/volumes.proto index 6ae22e293..4048621ed 100644 --- a/protos/volumes/v1/volumes.proto +++ b/cli/server/protos/volumes/v1/volumes.proto @@ -19,7 +19,7 @@ package com.docker.api.protos.volumes.v1; import "google/protobuf/any.proto"; -option go_package = "github.com/docker/compose-cli/protos/volumes/v1;v1"; +option go_package = "github.com/docker/compose-cli/cli/server/protos/volumes/v1;v1"; service Volumes { rpc VolumesCreate(VolumesCreateRequest) returns (VolumesCreateResponse); diff --git a/cli/server/proxy/compose.go b/cli/server/proxy/compose.go index 4fa76548b..edb07bcf3 100644 --- a/cli/server/proxy/compose.go +++ b/cli/server/proxy/compose.go @@ -24,7 +24,7 @@ import ( "github.com/compose-spec/compose-go/cli" "github.com/compose-spec/compose-go/types" - composev1 "github.com/docker/compose-cli/protos/compose/v1" + composev1 "github.com/docker/compose-cli/cli/server/protos/compose/v1" ) func (p *proxy) Up(ctx context.Context, request *composev1.ComposeUpRequest) (*composev1.ComposeUpResponse, error) { diff --git a/cli/server/proxy/containers.go b/cli/server/proxy/containers.go index 8a6e18c46..46bfc58cf 100644 --- a/cli/server/proxy/containers.go +++ b/cli/server/proxy/containers.go @@ -25,9 +25,9 @@ import ( specs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/docker/compose-cli/api/containers" + containersv1 "github.com/docker/compose-cli/cli/server/protos/containers/v1" "github.com/docker/compose-cli/cli/server/proxy/streams" "github.com/docker/compose-cli/formatter" - containersv1 "github.com/docker/compose-cli/protos/containers/v1" ) func portsToGrpc(ports []containers.Port) []*containersv1.Port { diff --git a/cli/server/proxy/containers_test.go b/cli/server/proxy/containers_test.go index 3389c32b1..e821e6da0 100644 --- a/cli/server/proxy/containers_test.go +++ b/cli/server/proxy/containers_test.go @@ -22,8 +22,8 @@ import ( "gotest.tools/v3/assert" "github.com/docker/compose-cli/api/containers" + containersv1 "github.com/docker/compose-cli/cli/server/protos/containers/v1" "github.com/docker/compose-cli/formatter" - containersv1 "github.com/docker/compose-cli/protos/containers/v1" ) func TestGrpcContainerToContainerConfig(t *testing.T) { diff --git a/cli/server/proxy/contexts.go b/cli/server/proxy/contexts.go index 10f3b3aa5..5d2d96e9c 100644 --- a/cli/server/proxy/contexts.go +++ b/cli/server/proxy/contexts.go @@ -19,9 +19,9 @@ package proxy import ( "context" + contextsv1 "github.com/docker/compose-cli/cli/server/protos/contexts/v1" "github.com/docker/compose-cli/config" "github.com/docker/compose-cli/context/store" - contextsv1 "github.com/docker/compose-cli/protos/contexts/v1" ) type contextsProxy struct { diff --git a/cli/server/proxy/contexts_test.go b/cli/server/proxy/contexts_test.go index 567d46a24..444d670db 100644 --- a/cli/server/proxy/contexts_test.go +++ b/cli/server/proxy/contexts_test.go @@ -21,8 +21,8 @@ import ( "gotest.tools/v3/assert" + contextsv1 "github.com/docker/compose-cli/cli/server/protos/contexts/v1" "github.com/docker/compose-cli/context/store" - contextsv1 "github.com/docker/compose-cli/protos/contexts/v1" "github.com/google/go-cmp/cmp/cmpopts" ) diff --git a/cli/server/proxy/proxy.go b/cli/server/proxy/proxy.go index bccd14532..617aa4595 100644 --- a/cli/server/proxy/proxy.go +++ b/cli/server/proxy/proxy.go @@ -21,13 +21,13 @@ import ( "sync" "github.com/docker/compose-cli/api/client" + composev1 "github.com/docker/compose-cli/cli/server/protos/compose/v1" + containersv1 "github.com/docker/compose-cli/cli/server/protos/containers/v1" + contextsv1 "github.com/docker/compose-cli/cli/server/protos/contexts/v1" + streamsv1 "github.com/docker/compose-cli/cli/server/protos/streams/v1" + volumesv1 "github.com/docker/compose-cli/cli/server/protos/volumes/v1" "github.com/docker/compose-cli/cli/server/proxy/streams" "github.com/docker/compose-cli/config" - composev1 "github.com/docker/compose-cli/protos/compose/v1" - containersv1 "github.com/docker/compose-cli/protos/containers/v1" - contextsv1 "github.com/docker/compose-cli/protos/contexts/v1" - streamsv1 "github.com/docker/compose-cli/protos/streams/v1" - volumesv1 "github.com/docker/compose-cli/protos/volumes/v1" ) type clientKey struct{} diff --git a/cli/server/proxy/streams.go b/cli/server/proxy/streams.go index aeeb954cd..763d61acc 100644 --- a/cli/server/proxy/streams.go +++ b/cli/server/proxy/streams.go @@ -21,8 +21,8 @@ import ( "github.com/sirupsen/logrus" "google.golang.org/grpc/metadata" + streamsv1 "github.com/docker/compose-cli/cli/server/protos/streams/v1" "github.com/docker/compose-cli/cli/server/proxy/streams" - streamsv1 "github.com/docker/compose-cli/protos/streams/v1" ) func (p *proxy) NewStream(stream streamsv1.Streaming_NewStreamServer) error { diff --git a/cli/server/proxy/streams/io.go b/cli/server/proxy/streams/io.go index b7e294622..28fd6fd06 100644 --- a/cli/server/proxy/streams/io.go +++ b/cli/server/proxy/streams/io.go @@ -19,7 +19,7 @@ package streams import ( "github.com/golang/protobuf/ptypes" - streamsv1 "github.com/docker/compose-cli/protos/streams/v1" + streamsv1 "github.com/docker/compose-cli/cli/server/protos/streams/v1" ) // IO implements an io.ReadWriter that forwards everything to the stream diff --git a/cli/server/proxy/streams/logs.go b/cli/server/proxy/streams/logs.go index 58a948516..52cff554a 100644 --- a/cli/server/proxy/streams/logs.go +++ b/cli/server/proxy/streams/logs.go @@ -21,7 +21,7 @@ import ( "google.golang.org/grpc" - containersv1 "github.com/docker/compose-cli/protos/containers/v1" + containersv1 "github.com/docker/compose-cli/cli/server/protos/containers/v1" ) // Log implements an io.Writer that proxies logs over a gRPC stream diff --git a/cli/server/proxy/streams/logs_test.go b/cli/server/proxy/streams/logs_test.go index 46a59e15e..eaa60b23c 100644 --- a/cli/server/proxy/streams/logs_test.go +++ b/cli/server/proxy/streams/logs_test.go @@ -24,7 +24,7 @@ import ( "gotest.tools/v3/assert" "gotest.tools/v3/assert/cmp" - v1 "github.com/docker/compose-cli/protos/containers/v1" + v1 "github.com/docker/compose-cli/cli/server/protos/containers/v1" ) type logServer struct { diff --git a/cli/server/proxy/streams/stream.go b/cli/server/proxy/streams/stream.go index 79d07b963..e10b3962b 100644 --- a/cli/server/proxy/streams/stream.go +++ b/cli/server/proxy/streams/stream.go @@ -19,7 +19,7 @@ package streams import ( "sync" - streamsv1 "github.com/docker/compose-cli/protos/streams/v1" + streamsv1 "github.com/docker/compose-cli/cli/server/protos/streams/v1" ) // Stream is a bidirectional stream for container IO diff --git a/cli/server/proxy/streams/stream_test.go b/cli/server/proxy/streams/stream_test.go index 1bc22aa26..bb6ea0b2c 100644 --- a/cli/server/proxy/streams/stream_test.go +++ b/cli/server/proxy/streams/stream_test.go @@ -29,7 +29,7 @@ import ( "gotest.tools/v3/assert" "gotest.tools/v3/assert/cmp" - streamsv1 "github.com/docker/compose-cli/protos/streams/v1" + streamsv1 "github.com/docker/compose-cli/cli/server/protos/streams/v1" ) type byteStream struct { diff --git a/cli/server/proxy/volumes.go b/cli/server/proxy/volumes.go index 6da274322..164d41510 100644 --- a/cli/server/proxy/volumes.go +++ b/cli/server/proxy/volumes.go @@ -21,7 +21,7 @@ import ( "github.com/docker/compose-cli/aci" "github.com/docker/compose-cli/api/volumes" - volumesv1 "github.com/docker/compose-cli/protos/volumes/v1" + volumesv1 "github.com/docker/compose-cli/cli/server/protos/volumes/v1" ) // VolumesCreate creates a volume.