From d06aa2827fcc628793a28154d066ec6d63ba2783 Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Mon, 7 Sep 2020 13:22:08 +0200 Subject: [PATCH 1/3] Move containers, compose, secrets to /api Signed-off-by: Guillaume Tardif --- aci/aci.go | 2 +- aci/backend.go | 6 +- aci/backend_test.go | 2 +- aci/convert/container.go | 2 +- aci/convert/container_test.go | 2 +- aci/convert/convert.go | 4 +- aci/convert/convert_test.go | 4 +- aci/convert/ports.go | 2 +- aci/convert/ports_test.go | 2 +- api/client/client.go | 88 +++++++++++++++++++++++++++ api/client/compose.go | 60 ++++++++++++++++++ api/client/containers.go | 71 +++++++++++++++++++++ api/client/secrets.go | 43 +++++++++++++ {compose => api/compose}/api.go | 0 {compose => api/compose}/tags.go | 0 {containers => api/containers}/api.go | 0 {secrets => api/secrets}/api.go | 0 backend/backend.go | 6 +- cli/cmd/exec.go | 2 +- cli/cmd/logs.go | 2 +- cli/cmd/rm.go | 2 +- cli/cmd/run/run.go | 2 +- cli/cmd/secrets.go | 2 +- cli/cmd/secrets_test.go | 2 +- cli/options/run/opts.go | 2 +- cli/options/run/opts_test.go | 2 +- client/client.go | 6 +- client/compose.go | 2 +- client/containers.go | 2 +- client/secrets.go | 2 +- ecs/backend.go | 6 +- ecs/cloudformation.go | 2 +- ecs/cloudformation_test.go | 2 +- ecs/list.go | 2 +- ecs/local/backend.go | 6 +- ecs/local/compose.go | 2 +- ecs/ps.go | 2 +- ecs/sdk.go | 4 +- ecs/secrets.go | 2 +- example/backend.go | 6 +- local/backend.go | 6 +- server/proxy/containers.go | 2 +- server/proxy/containers_test.go | 2 +- tests/aci-e2e/e2e-aci_test.go | 2 +- tests/framework/e2e.go | 2 +- utils/formatter/container.go | 2 +- 46 files changed, 317 insertions(+), 55 deletions(-) create mode 100644 api/client/client.go create mode 100644 api/client/compose.go create mode 100644 api/client/containers.go create mode 100644 api/client/secrets.go rename {compose => api/compose}/api.go (100%) rename {compose => api/compose}/tags.go (100%) rename {containers => api/containers}/api.go (100%) rename {secrets => api/secrets}/api.go (100%) diff --git a/aci/aci.go b/aci/aci.go index ec189a29..4a251d3f 100644 --- a/aci/aci.go +++ b/aci/aci.go @@ -35,7 +35,7 @@ import ( "github.com/docker/compose-cli/aci/convert" "github.com/docker/compose-cli/aci/login" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" "github.com/docker/compose-cli/context/store" "github.com/docker/compose-cli/errdefs" "github.com/docker/compose-cli/progress" diff --git a/aci/backend.go b/aci/backend.go index 0aaba0e1..02b578bf 100644 --- a/aci/backend.go +++ b/aci/backend.go @@ -33,14 +33,14 @@ import ( "github.com/docker/compose-cli/aci/convert" "github.com/docker/compose-cli/aci/login" + "github.com/docker/compose-cli/api/compose" + "github.com/docker/compose-cli/api/containers" + "github.com/docker/compose-cli/api/secrets" "github.com/docker/compose-cli/backend" - "github.com/docker/compose-cli/compose" - "github.com/docker/compose-cli/containers" apicontext "github.com/docker/compose-cli/context" "github.com/docker/compose-cli/context/cloud" "github.com/docker/compose-cli/context/store" "github.com/docker/compose-cli/errdefs" - "github.com/docker/compose-cli/secrets" ) const ( diff --git a/aci/backend_test.go b/aci/backend_test.go index cea120bc..aafcb52d 100644 --- a/aci/backend_test.go +++ b/aci/backend_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/mock" "gotest.tools/v3/assert" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" ) func TestGetContainerName(t *testing.T) { diff --git a/aci/convert/container.go b/aci/convert/container.go index 561e6083..5d1d6e51 100644 --- a/aci/convert/container.go +++ b/aci/convert/container.go @@ -22,7 +22,7 @@ import ( "github.com/compose-spec/compose-go/types" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" ) // ContainerToComposeProject convert container config to compose project diff --git a/aci/convert/container_test.go b/aci/convert/container_test.go index 8c10b5c7..1227aa9e 100644 --- a/aci/convert/container_test.go +++ b/aci/convert/container_test.go @@ -23,7 +23,7 @@ import ( "github.com/compose-spec/compose-go/types" "gotest.tools/v3/assert" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" ) func TestConvertContainerEnvironment(t *testing.T) { diff --git a/aci/convert/convert.go b/aci/convert/convert.go index 79a959b6..3df1ee05 100644 --- a/aci/convert/convert.go +++ b/aci/convert/convert.go @@ -26,7 +26,7 @@ import ( "strconv" "strings" - "github.com/docker/compose-cli/compose" + "github.com/docker/compose-cli/api/compose" "github.com/docker/compose-cli/utils/formatter" "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance" @@ -35,7 +35,7 @@ import ( "github.com/pkg/errors" "github.com/docker/compose-cli/aci/login" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" "github.com/docker/compose-cli/context/store" ) diff --git a/aci/convert/convert_test.go b/aci/convert/convert_test.go index dfc60a09..d6c656dd 100644 --- a/aci/convert/convert_test.go +++ b/aci/convert/convert_test.go @@ -21,7 +21,7 @@ import ( "os" "testing" - "github.com/docker/compose-cli/compose" + "github.com/docker/compose-cli/api/compose" "github.com/Azure/azure-sdk-for-go/profiles/latest/containerinstance/mgmt/containerinstance" "github.com/Azure/go-autorest/autorest/to" @@ -29,7 +29,7 @@ import ( "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" "github.com/docker/compose-cli/context/store" ) diff --git a/aci/convert/ports.go b/aci/convert/ports.go index 6111ed59..336596a3 100644 --- a/aci/convert/ports.go +++ b/aci/convert/ports.go @@ -21,7 +21,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" ) // ToPorts converts Azure container ports to api ports diff --git a/aci/convert/ports_test.go b/aci/convert/ports_test.go index 6a7ce80d..f9b9a378 100644 --- a/aci/convert/ports_test.go +++ b/aci/convert/ports_test.go @@ -23,7 +23,7 @@ import ( "github.com/Azure/go-autorest/autorest/to" "gotest.tools/v3/assert" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" ) func TestPortConvert(t *testing.T) { diff --git a/api/client/client.go b/api/client/client.go new file mode 100644 index 00000000..a6e19bf2 --- /dev/null +++ b/api/client/client.go @@ -0,0 +1,88 @@ +/* + Copyright 2020 Docker, Inc. + + 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 client + +import ( + "context" + + "github.com/docker/compose-cli/api/compose" + "github.com/docker/compose-cli/api/containers" + "github.com/docker/compose-cli/api/secrets" + "github.com/docker/compose-cli/backend" + apicontext "github.com/docker/compose-cli/context" + "github.com/docker/compose-cli/context/cloud" + "github.com/docker/compose-cli/context/store" +) + +// New returns a backend client associated with current context +func New(ctx context.Context) (*Client, error) { + currentContext := apicontext.CurrentContext(ctx) + s := store.ContextStore(ctx) + + cc, err := s.Get(currentContext) + if err != nil { + return nil, err + } + + service, err := backend.Get(ctx, cc.Type()) + if err != nil { + return nil, err + } + + return &Client{ + backendType: cc.Type(), + bs: service, + }, nil +} + +// GetCloudService returns a backend CloudService (typically login, create context) +func GetCloudService(ctx context.Context, backendType string) (cloud.Service, error) { + return backend.GetCloudService(ctx, backendType) +} + +// Client is a multi-backend client +type Client struct { + backendType string + bs backend.Service +} + +// ContainerService returns the backend service for the current context +func (c *Client) ContainerService() containers.Service { + if cs := c.bs.ContainerService(); cs != nil { + return cs + } + + return &containerService{} +} + +// ComposeService returns the backend service for the current context +func (c *Client) ComposeService() compose.Service { + if cs := c.bs.ComposeService(); cs != nil { + return cs + } + + return &composeService{} +} + +// SecretsService returns the backend service for the current context +func (c *Client) SecretsService() secrets.Service { + if ss := c.bs.SecretsService(); ss != nil { + return ss + } + + return &secretsService{} +} diff --git a/api/client/compose.go b/api/client/compose.go new file mode 100644 index 00000000..91387f24 --- /dev/null +++ b/api/client/compose.go @@ -0,0 +1,60 @@ +/* + Copyright 2020 Docker, Inc. + + 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 client + +import ( + "context" + "io" + + "github.com/compose-spec/compose-go/types" + + "github.com/docker/compose-cli/api/compose" + "github.com/docker/compose-cli/errdefs" +) + +type composeService struct { +} + +// Up executes the equivalent to a `compose up` +func (c *composeService) Up(context.Context, *types.Project) error { + return errdefs.ErrNotImplemented +} + +// Down executes the equivalent to a `compose down` +func (c *composeService) Down(context.Context, string) error { + return errdefs.ErrNotImplemented +} + +// Logs executes the equivalent to a `compose logs` +func (c *composeService) Logs(context.Context, string, io.Writer) error { + return errdefs.ErrNotImplemented +} + +// Ps executes the equivalent to a `compose ps` +func (c *composeService) Ps(context.Context, string) ([]compose.ServiceStatus, error) { + return nil, errdefs.ErrNotImplemented +} + +// List executes the equivalent to a `docker stack ls` +func (c *composeService) List(context.Context, string) ([]compose.Stack, error) { + return nil, errdefs.ErrNotImplemented +} + +// Convert translate compose model into backend's native format +func (c *composeService) Convert(context.Context, *types.Project) ([]byte, error) { + return nil, errdefs.ErrNotImplemented +} diff --git a/api/client/containers.go b/api/client/containers.go new file mode 100644 index 00000000..41639f38 --- /dev/null +++ b/api/client/containers.go @@ -0,0 +1,71 @@ +/* + Copyright 2020 Docker, Inc. + + 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 client + +import ( + "context" + + "github.com/docker/compose-cli/api/containers" + "github.com/docker/compose-cli/errdefs" +) + +type containerService struct { +} + +// List returns all the containers +func (c *containerService) List(context.Context, bool) ([]containers.Container, error) { + return nil, errdefs.ErrNotImplemented +} + +// Start starts a stopped container +func (c *containerService) Start(context.Context, string) error { + return errdefs.ErrNotImplemented +} + +// Stop stops the running container +func (c *containerService) Stop(context.Context, string, *uint32) error { + return errdefs.ErrNotImplemented +} + +func (c *containerService) Kill(ctx context.Context, containerID string, signal string) error { + return errdefs.ErrNotImplemented +} + +// Run creates and starts a container +func (c *containerService) Run(context.Context, containers.ContainerConfig) error { + return errdefs.ErrNotImplemented +} + +// Exec executes a command inside a running container +func (c *containerService) Exec(context.Context, string, containers.ExecRequest) error { + return errdefs.ErrNotImplemented +} + +// Logs returns all the logs of a container +func (c *containerService) Logs(context.Context, string, containers.LogsRequest) error { + return errdefs.ErrNotImplemented +} + +// Delete removes containers +func (c *containerService) Delete(context.Context, string, containers.DeleteRequest) error { + return errdefs.ErrNotImplemented +} + +// Inspect get a specific container +func (c *containerService) Inspect(context.Context, string) (containers.Container, error) { + return containers.Container{}, errdefs.ErrNotImplemented +} diff --git a/api/client/secrets.go b/api/client/secrets.go new file mode 100644 index 00000000..24a754b1 --- /dev/null +++ b/api/client/secrets.go @@ -0,0 +1,43 @@ +/* + Copyright 2020 Docker, Inc. + + 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 client + +import ( + "context" + + "github.com/docker/compose-cli/api/secrets" + "github.com/docker/compose-cli/errdefs" +) + +type secretsService struct { +} + +func (s *secretsService) CreateSecret(context.Context, secrets.Secret) (string, error) { + return "", errdefs.ErrNotImplemented +} + +func (s *secretsService) InspectSecret(context.Context, string) (secrets.Secret, error) { + return secrets.Secret{}, errdefs.ErrNotImplemented +} + +func (s *secretsService) ListSecrets(context.Context) ([]secrets.Secret, error) { + return nil, errdefs.ErrNotImplemented +} + +func (s *secretsService) DeleteSecret(context.Context, string, bool) error { + return errdefs.ErrNotImplemented +} diff --git a/compose/api.go b/api/compose/api.go similarity index 100% rename from compose/api.go rename to api/compose/api.go diff --git a/compose/tags.go b/api/compose/tags.go similarity index 100% rename from compose/tags.go rename to api/compose/tags.go diff --git a/containers/api.go b/api/containers/api.go similarity index 100% rename from containers/api.go rename to api/containers/api.go diff --git a/secrets/api.go b/api/secrets/api.go similarity index 100% rename from secrets/api.go rename to api/secrets/api.go diff --git a/backend/backend.go b/backend/backend.go index 8f3a3601..8185f873 100644 --- a/backend/backend.go +++ b/backend/backend.go @@ -23,11 +23,11 @@ import ( "github.com/sirupsen/logrus" - "github.com/docker/compose-cli/compose" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/compose" + "github.com/docker/compose-cli/api/containers" + "github.com/docker/compose-cli/api/secrets" "github.com/docker/compose-cli/context/cloud" "github.com/docker/compose-cli/errdefs" - "github.com/docker/compose-cli/secrets" ) var ( diff --git a/cli/cmd/exec.go b/cli/cmd/exec.go index 13644d12..736c2552 100644 --- a/cli/cmd/exec.go +++ b/cli/cmd/exec.go @@ -26,8 +26,8 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" + "github.com/docker/compose-cli/api/containers" "github.com/docker/compose-cli/client" - "github.com/docker/compose-cli/containers" ) type execOpts struct { diff --git a/cli/cmd/logs.go b/cli/cmd/logs.go index 83e917b0..4c152f49 100644 --- a/cli/cmd/logs.go +++ b/cli/cmd/logs.go @@ -25,8 +25,8 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" + "github.com/docker/compose-cli/api/containers" "github.com/docker/compose-cli/client" - "github.com/docker/compose-cli/containers" ) type logsOpts struct { diff --git a/cli/cmd/rm.go b/cli/cmd/rm.go index f53bf6c5..8f2cc00b 100644 --- a/cli/cmd/rm.go +++ b/cli/cmd/rm.go @@ -25,8 +25,8 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" + "github.com/docker/compose-cli/api/containers" "github.com/docker/compose-cli/client" - "github.com/docker/compose-cli/containers" "github.com/docker/compose-cli/errdefs" ) diff --git a/cli/cmd/run/run.go b/cli/cmd/run/run.go index 8a72c1a6..1e2ee164 100644 --- a/cli/cmd/run/run.go +++ b/cli/cmd/run/run.go @@ -25,7 +25,7 @@ import ( "github.com/containerd/console" "github.com/spf13/cobra" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" "github.com/docker/compose-cli/cli/options/run" "github.com/docker/compose-cli/client" diff --git a/cli/cmd/secrets.go b/cli/cmd/secrets.go index 2351729f..9c569907 100644 --- a/cli/cmd/secrets.go +++ b/cli/cmd/secrets.go @@ -25,8 +25,8 @@ import ( "github.com/spf13/cobra" + "github.com/docker/compose-cli/api/secrets" "github.com/docker/compose-cli/client" - "github.com/docker/compose-cli/secrets" ) type createSecretOptions struct { diff --git a/cli/cmd/secrets_test.go b/cli/cmd/secrets_test.go index 162b6367..70968136 100644 --- a/cli/cmd/secrets_test.go +++ b/cli/cmd/secrets_test.go @@ -22,7 +22,7 @@ import ( "gotest.tools/v3/golden" - "github.com/docker/compose-cli/secrets" + "github.com/docker/compose-cli/api/secrets" ) func TestPrintList(t *testing.T) { diff --git a/cli/options/run/opts.go b/cli/options/run/opts.go index bc7e3e05..91e68451 100644 --- a/cli/options/run/opts.go +++ b/cli/options/run/opts.go @@ -26,7 +26,7 @@ import ( "github.com/docker/docker/pkg/namesgenerator" "github.com/docker/go-connections/nat" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" "github.com/docker/compose-cli/formatter" ) diff --git a/cli/options/run/opts_test.go b/cli/options/run/opts_test.go index 58a4bf03..acf41c86 100644 --- a/cli/options/run/opts_test.go +++ b/cli/options/run/opts_test.go @@ -25,7 +25,7 @@ import ( "gotest.tools/v3/assert" "gotest.tools/v3/assert/cmp" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" ) var ( diff --git a/client/client.go b/client/client.go index 4b956a46..a6e19bf2 100644 --- a/client/client.go +++ b/client/client.go @@ -19,13 +19,13 @@ package client import ( "context" + "github.com/docker/compose-cli/api/compose" + "github.com/docker/compose-cli/api/containers" + "github.com/docker/compose-cli/api/secrets" "github.com/docker/compose-cli/backend" - "github.com/docker/compose-cli/compose" - "github.com/docker/compose-cli/containers" apicontext "github.com/docker/compose-cli/context" "github.com/docker/compose-cli/context/cloud" "github.com/docker/compose-cli/context/store" - "github.com/docker/compose-cli/secrets" ) // New returns a backend client associated with current context diff --git a/client/compose.go b/client/compose.go index 3bda3048..91387f24 100644 --- a/client/compose.go +++ b/client/compose.go @@ -22,7 +22,7 @@ import ( "github.com/compose-spec/compose-go/types" - "github.com/docker/compose-cli/compose" + "github.com/docker/compose-cli/api/compose" "github.com/docker/compose-cli/errdefs" ) diff --git a/client/containers.go b/client/containers.go index eaa57d0d..41639f38 100644 --- a/client/containers.go +++ b/client/containers.go @@ -19,7 +19,7 @@ package client import ( "context" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" "github.com/docker/compose-cli/errdefs" ) diff --git a/client/secrets.go b/client/secrets.go index 254318f3..24a754b1 100644 --- a/client/secrets.go +++ b/client/secrets.go @@ -19,8 +19,8 @@ package client import ( "context" + "github.com/docker/compose-cli/api/secrets" "github.com/docker/compose-cli/errdefs" - "github.com/docker/compose-cli/secrets" ) type secretsService struct { diff --git a/ecs/backend.go b/ecs/backend.go index f5ab5e49..ec18fe02 100644 --- a/ecs/backend.go +++ b/ecs/backend.go @@ -22,14 +22,14 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" + "github.com/docker/compose-cli/api/compose" + "github.com/docker/compose-cli/api/containers" + "github.com/docker/compose-cli/api/secrets" "github.com/docker/compose-cli/backend" - "github.com/docker/compose-cli/compose" - "github.com/docker/compose-cli/containers" apicontext "github.com/docker/compose-cli/context" "github.com/docker/compose-cli/context/cloud" "github.com/docker/compose-cli/context/store" "github.com/docker/compose-cli/errdefs" - "github.com/docker/compose-cli/secrets" ) const backendType = store.EcsContextType diff --git a/ecs/cloudformation.go b/ecs/cloudformation.go index 40263728..6a8c5bde 100644 --- a/ecs/cloudformation.go +++ b/ecs/cloudformation.go @@ -23,7 +23,7 @@ import ( "regexp" "strings" - "github.com/docker/compose-cli/compose" + "github.com/docker/compose-cli/api/compose" ecsapi "github.com/aws/aws-sdk-go/service/ecs" "github.com/aws/aws-sdk-go/service/elbv2" diff --git a/ecs/cloudformation_test.go b/ecs/cloudformation_test.go index f12ff4a4..2e0932dc 100644 --- a/ecs/cloudformation_test.go +++ b/ecs/cloudformation_test.go @@ -21,7 +21,7 @@ import ( "reflect" "testing" - "github.com/docker/compose-cli/compose" + "github.com/docker/compose-cli/api/compose" "github.com/aws/aws-sdk-go/service/elbv2" "github.com/awslabs/goformation/v4/cloudformation" diff --git a/ecs/list.go b/ecs/list.go index cfe01ccc..48873cd8 100644 --- a/ecs/list.go +++ b/ecs/list.go @@ -19,7 +19,7 @@ package ecs import ( "context" - "github.com/docker/compose-cli/compose" + "github.com/docker/compose-cli/api/compose" ) func (b *ecsAPIService) List(ctx context.Context, project string) ([]compose.Stack, error) { diff --git a/ecs/local/backend.go b/ecs/local/backend.go index 31633005..1310cfec 100644 --- a/ecs/local/backend.go +++ b/ecs/local/backend.go @@ -19,9 +19,9 @@ package local import ( "context" - "github.com/docker/compose-cli/compose" - "github.com/docker/compose-cli/containers" - "github.com/docker/compose-cli/secrets" + "github.com/docker/compose-cli/api/compose" + "github.com/docker/compose-cli/api/containers" + "github.com/docker/compose-cli/api/secrets" "github.com/docker/docker/client" "github.com/docker/compose-cli/backend" diff --git a/ecs/local/compose.go b/ecs/local/compose.go index 080318de..fe2f756a 100644 --- a/ecs/local/compose.go +++ b/ecs/local/compose.go @@ -30,7 +30,7 @@ import ( types2 "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" - "github.com/docker/compose-cli/compose" + "github.com/docker/compose-cli/api/compose" "github.com/docker/compose-cli/errdefs" "github.com/aws/aws-sdk-go/aws" diff --git a/ecs/ps.go b/ecs/ps.go index e1c643e0..eee44a93 100644 --- a/ecs/ps.go +++ b/ecs/ps.go @@ -21,7 +21,7 @@ import ( "fmt" "strings" - "github.com/docker/compose-cli/compose" + "github.com/docker/compose-cli/api/compose" ) func (b *ecsAPIService) Ps(ctx context.Context, project string) ([]compose.ServiceStatus, error) { diff --git a/ecs/sdk.go b/ecs/sdk.go index 8346ba16..426081c5 100644 --- a/ecs/sdk.go +++ b/ecs/sdk.go @@ -24,8 +24,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" - "github.com/docker/compose-cli/compose" - "github.com/docker/compose-cli/secrets" + "github.com/docker/compose-cli/api/compose" + "github.com/docker/compose-cli/api/secrets" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" diff --git a/ecs/secrets.go b/ecs/secrets.go index 03c8b8e7..662b10c9 100644 --- a/ecs/secrets.go +++ b/ecs/secrets.go @@ -19,7 +19,7 @@ package ecs import ( "context" - "github.com/docker/compose-cli/secrets" + "github.com/docker/compose-cli/api/secrets" ) func (b *ecsAPIService) CreateSecret(ctx context.Context, secret secrets.Secret) (string, error) { diff --git a/example/backend.go b/example/backend.go index bc0d5646..2f9b420c 100644 --- a/example/backend.go +++ b/example/backend.go @@ -26,12 +26,12 @@ import ( "github.com/compose-spec/compose-go/types" + "github.com/docker/compose-cli/api/compose" + "github.com/docker/compose-cli/api/containers" + "github.com/docker/compose-cli/api/secrets" "github.com/docker/compose-cli/backend" - "github.com/docker/compose-cli/compose" - "github.com/docker/compose-cli/containers" "github.com/docker/compose-cli/context/cloud" "github.com/docker/compose-cli/errdefs" - "github.com/docker/compose-cli/secrets" ) type apiService struct { diff --git a/local/backend.go b/local/backend.go index 26b5c587..63acaae6 100644 --- a/local/backend.go +++ b/local/backend.go @@ -36,12 +36,12 @@ import ( "github.com/docker/docker/pkg/stdcopy" "github.com/pkg/errors" + "github.com/docker/compose-cli/api/compose" + "github.com/docker/compose-cli/api/containers" + "github.com/docker/compose-cli/api/secrets" "github.com/docker/compose-cli/backend" - "github.com/docker/compose-cli/compose" - "github.com/docker/compose-cli/containers" "github.com/docker/compose-cli/context/cloud" "github.com/docker/compose-cli/errdefs" - "github.com/docker/compose-cli/secrets" ) type local struct { diff --git a/server/proxy/containers.go b/server/proxy/containers.go index dc3cc338..1962be0b 100644 --- a/server/proxy/containers.go +++ b/server/proxy/containers.go @@ -20,7 +20,7 @@ import ( "context" "errors" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" "github.com/docker/compose-cli/formatter" containersv1 "github.com/docker/compose-cli/protos/containers/v1" "github.com/docker/compose-cli/server/proxy/streams" diff --git a/server/proxy/containers_test.go b/server/proxy/containers_test.go index 269be723..03577854 100644 --- a/server/proxy/containers_test.go +++ b/server/proxy/containers_test.go @@ -21,7 +21,7 @@ import ( "gotest.tools/v3/assert" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" "github.com/docker/compose-cli/formatter" containersv1 "github.com/docker/compose-cli/protos/containers/v1" ) diff --git a/tests/aci-e2e/e2e-aci_test.go b/tests/aci-e2e/e2e-aci_test.go index c16afeb7..13e32a49 100644 --- a/tests/aci-e2e/e2e-aci_test.go +++ b/tests/aci-e2e/e2e-aci_test.go @@ -45,7 +45,7 @@ import ( "github.com/docker/compose-cli/aci" "github.com/docker/compose-cli/aci/login" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" "github.com/docker/compose-cli/context/store" "github.com/docker/compose-cli/errdefs" "github.com/docker/compose-cli/tests/aci-e2e/storage" diff --git a/tests/framework/e2e.go b/tests/framework/e2e.go index 8dc685e1..91234fe5 100644 --- a/tests/framework/e2e.go +++ b/tests/framework/e2e.go @@ -33,7 +33,7 @@ import ( is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/icmd" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" ) var ( diff --git a/utils/formatter/container.go b/utils/formatter/container.go index 072c03e2..197a760e 100644 --- a/utils/formatter/container.go +++ b/utils/formatter/container.go @@ -22,7 +22,7 @@ import ( "strconv" "strings" - "github.com/docker/compose-cli/containers" + "github.com/docker/compose-cli/api/containers" ) type portGroup struct { From 64a28f663609230111842e562479209397189ee7 Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Mon, 7 Sep 2020 13:23:06 +0200 Subject: [PATCH 2/3] Also move client => api/client Signed-off-by: Guillaume Tardif --- cli/cmd/compose/compose.go | 2 +- cli/cmd/compose/convert.go | 2 +- cli/cmd/compose/down.go | 2 +- cli/cmd/compose/list.go | 2 +- cli/cmd/compose/logs.go | 2 +- cli/cmd/compose/ps.go | 2 +- cli/cmd/compose/up.go | 2 +- cli/cmd/context/create_aci.go | 2 +- cli/cmd/context/create_ecs.go | 2 +- cli/cmd/exec.go | 2 +- cli/cmd/inspect.go | 2 +- cli/cmd/kill.go | 2 +- cli/cmd/login/login.go | 2 +- cli/cmd/logout/azure.go | 2 +- cli/cmd/logs.go | 2 +- cli/cmd/ps.go | 2 +- cli/cmd/rm.go | 2 +- cli/cmd/run/run.go | 2 +- cli/cmd/secrets.go | 2 +- cli/cmd/start.go | 2 +- cli/cmd/stop.go | 2 +- client/client.go | 88 ----------------------------------- client/compose.go | 60 ------------------------ client/containers.go | 71 ---------------------------- client/secrets.go | 43 ----------------- server/interceptor.go | 2 +- server/proxy/proxy.go | 2 +- 27 files changed, 23 insertions(+), 285 deletions(-) delete mode 100644 client/client.go delete mode 100644 client/compose.go delete mode 100644 client/containers.go delete mode 100644 client/secrets.go diff --git a/cli/cmd/compose/compose.go b/cli/cmd/compose/compose.go index 90a18556..83c89cde 100644 --- a/cli/cmd/compose/compose.go +++ b/cli/cmd/compose/compose.go @@ -23,7 +23,7 @@ import ( "github.com/spf13/cobra" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/errdefs" ) diff --git a/cli/cmd/compose/convert.go b/cli/cmd/compose/convert.go index 10e577f4..7a0360c6 100644 --- a/cli/cmd/compose/convert.go +++ b/cli/cmd/compose/convert.go @@ -23,7 +23,7 @@ import ( "github.com/compose-spec/compose-go/cli" "github.com/spf13/cobra" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" ) func convertCommand() *cobra.Command { diff --git a/cli/cmd/compose/down.go b/cli/cmd/compose/down.go index a49d003d..44281fa3 100644 --- a/cli/cmd/compose/down.go +++ b/cli/cmd/compose/down.go @@ -21,7 +21,7 @@ import ( "github.com/spf13/cobra" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/progress" ) diff --git a/cli/cmd/compose/list.go b/cli/cmd/compose/list.go index ba71db24..03346f59 100644 --- a/cli/cmd/compose/list.go +++ b/cli/cmd/compose/list.go @@ -24,7 +24,7 @@ import ( "github.com/spf13/cobra" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" ) func listCommand() *cobra.Command { diff --git a/cli/cmd/compose/logs.go b/cli/cmd/compose/logs.go index de86e223..e8e83cee 100644 --- a/cli/cmd/compose/logs.go +++ b/cli/cmd/compose/logs.go @@ -22,7 +22,7 @@ import ( "github.com/spf13/cobra" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" ) func logsCommand() *cobra.Command { diff --git a/cli/cmd/compose/ps.go b/cli/cmd/compose/ps.go index e52f8049..038f0312 100644 --- a/cli/cmd/compose/ps.go +++ b/cli/cmd/compose/ps.go @@ -26,7 +26,7 @@ import ( "github.com/spf13/cobra" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" ) func psCommand() *cobra.Command { diff --git a/cli/cmd/compose/up.go b/cli/cmd/compose/up.go index f4f70da2..b1914128 100644 --- a/cli/cmd/compose/up.go +++ b/cli/cmd/compose/up.go @@ -23,7 +23,7 @@ import ( "github.com/spf13/cobra" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/progress" ) diff --git a/cli/cmd/context/create_aci.go b/cli/cmd/context/create_aci.go index 32ebb3e9..ac07f8e4 100644 --- a/cli/cmd/context/create_aci.go +++ b/cli/cmd/context/create_aci.go @@ -23,7 +23,7 @@ import ( "github.com/spf13/cobra" "github.com/docker/compose-cli/aci" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/context/store" "github.com/docker/compose-cli/errdefs" ) diff --git a/cli/cmd/context/create_ecs.go b/cli/cmd/context/create_ecs.go index 979b881c..78fb6266 100644 --- a/cli/cmd/context/create_ecs.go +++ b/cli/cmd/context/create_ecs.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/context/store" "github.com/docker/compose-cli/ecs" "github.com/docker/compose-cli/errdefs" diff --git a/cli/cmd/exec.go b/cli/cmd/exec.go index 736c2552..7d09f2dd 100644 --- a/cli/cmd/exec.go +++ b/cli/cmd/exec.go @@ -26,8 +26,8 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/api/containers" - "github.com/docker/compose-cli/client" ) type execOpts struct { diff --git a/cli/cmd/inspect.go b/cli/cmd/inspect.go index 6eac9fb3..7ffe50da 100644 --- a/cli/cmd/inspect.go +++ b/cli/cmd/inspect.go @@ -23,7 +23,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/formatter" ) diff --git a/cli/cmd/kill.go b/cli/cmd/kill.go index 08c2c4f1..1eff1aab 100644 --- a/cli/cmd/kill.go +++ b/cli/cmd/kill.go @@ -25,7 +25,7 @@ import ( "github.com/hashicorp/go-multierror" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/errdefs" ) diff --git a/cli/cmd/login/login.go b/cli/cmd/login/login.go index 90413ba7..11ca6eeb 100644 --- a/cli/cmd/login/login.go +++ b/cli/cmd/login/login.go @@ -26,8 +26,8 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/cli/mobycli" - "github.com/docker/compose-cli/client" "github.com/docker/compose-cli/errdefs" ) diff --git a/cli/cmd/logout/azure.go b/cli/cmd/logout/azure.go index 6f7ee0b9..44d305c9 100644 --- a/cli/cmd/logout/azure.go +++ b/cli/cmd/logout/azure.go @@ -23,7 +23,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/errdefs" ) diff --git a/cli/cmd/logs.go b/cli/cmd/logs.go index 4c152f49..dc478f4e 100644 --- a/cli/cmd/logs.go +++ b/cli/cmd/logs.go @@ -25,8 +25,8 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/api/containers" - "github.com/docker/compose-cli/client" ) type logsOpts struct { diff --git a/cli/cmd/ps.go b/cli/cmd/ps.go index 400fd135..b918b6cd 100644 --- a/cli/cmd/ps.go +++ b/cli/cmd/ps.go @@ -28,7 +28,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" formatter2 "github.com/docker/compose-cli/formatter" ) diff --git a/cli/cmd/rm.go b/cli/cmd/rm.go index 8f2cc00b..f61f86dd 100644 --- a/cli/cmd/rm.go +++ b/cli/cmd/rm.go @@ -25,8 +25,8 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/api/containers" - "github.com/docker/compose-cli/client" "github.com/docker/compose-cli/errdefs" ) diff --git a/cli/cmd/run/run.go b/cli/cmd/run/run.go index 1e2ee164..a4283eba 100644 --- a/cli/cmd/run/run.go +++ b/cli/cmd/run/run.go @@ -27,8 +27,8 @@ import ( "github.com/docker/compose-cli/api/containers" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/cli/options/run" - "github.com/docker/compose-cli/client" "github.com/docker/compose-cli/progress" ) diff --git a/cli/cmd/secrets.go b/cli/cmd/secrets.go index 9c569907..539fef93 100644 --- a/cli/cmd/secrets.go +++ b/cli/cmd/secrets.go @@ -25,8 +25,8 @@ import ( "github.com/spf13/cobra" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/api/secrets" - "github.com/docker/compose-cli/client" ) type createSecretOptions struct { diff --git a/cli/cmd/start.go b/cli/cmd/start.go index cb27abf5..f65dd1d5 100644 --- a/cli/cmd/start.go +++ b/cli/cmd/start.go @@ -27,7 +27,7 @@ import ( "github.com/hashicorp/go-multierror" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" ) // StartCommand starts containers diff --git a/cli/cmd/stop.go b/cli/cmd/stop.go index e0003fd9..cbfeb385 100644 --- a/cli/cmd/stop.go +++ b/cli/cmd/stop.go @@ -27,7 +27,7 @@ import ( "github.com/hashicorp/go-multierror" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" ) type stopOpts struct { diff --git a/client/client.go b/client/client.go deleted file mode 100644 index a6e19bf2..00000000 --- a/client/client.go +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright 2020 Docker, Inc. - - 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 client - -import ( - "context" - - "github.com/docker/compose-cli/api/compose" - "github.com/docker/compose-cli/api/containers" - "github.com/docker/compose-cli/api/secrets" - "github.com/docker/compose-cli/backend" - apicontext "github.com/docker/compose-cli/context" - "github.com/docker/compose-cli/context/cloud" - "github.com/docker/compose-cli/context/store" -) - -// New returns a backend client associated with current context -func New(ctx context.Context) (*Client, error) { - currentContext := apicontext.CurrentContext(ctx) - s := store.ContextStore(ctx) - - cc, err := s.Get(currentContext) - if err != nil { - return nil, err - } - - service, err := backend.Get(ctx, cc.Type()) - if err != nil { - return nil, err - } - - return &Client{ - backendType: cc.Type(), - bs: service, - }, nil -} - -// GetCloudService returns a backend CloudService (typically login, create context) -func GetCloudService(ctx context.Context, backendType string) (cloud.Service, error) { - return backend.GetCloudService(ctx, backendType) -} - -// Client is a multi-backend client -type Client struct { - backendType string - bs backend.Service -} - -// ContainerService returns the backend service for the current context -func (c *Client) ContainerService() containers.Service { - if cs := c.bs.ContainerService(); cs != nil { - return cs - } - - return &containerService{} -} - -// ComposeService returns the backend service for the current context -func (c *Client) ComposeService() compose.Service { - if cs := c.bs.ComposeService(); cs != nil { - return cs - } - - return &composeService{} -} - -// SecretsService returns the backend service for the current context -func (c *Client) SecretsService() secrets.Service { - if ss := c.bs.SecretsService(); ss != nil { - return ss - } - - return &secretsService{} -} diff --git a/client/compose.go b/client/compose.go deleted file mode 100644 index 91387f24..00000000 --- a/client/compose.go +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2020 Docker, Inc. - - 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 client - -import ( - "context" - "io" - - "github.com/compose-spec/compose-go/types" - - "github.com/docker/compose-cli/api/compose" - "github.com/docker/compose-cli/errdefs" -) - -type composeService struct { -} - -// Up executes the equivalent to a `compose up` -func (c *composeService) Up(context.Context, *types.Project) error { - return errdefs.ErrNotImplemented -} - -// Down executes the equivalent to a `compose down` -func (c *composeService) Down(context.Context, string) error { - return errdefs.ErrNotImplemented -} - -// Logs executes the equivalent to a `compose logs` -func (c *composeService) Logs(context.Context, string, io.Writer) error { - return errdefs.ErrNotImplemented -} - -// Ps executes the equivalent to a `compose ps` -func (c *composeService) Ps(context.Context, string) ([]compose.ServiceStatus, error) { - return nil, errdefs.ErrNotImplemented -} - -// List executes the equivalent to a `docker stack ls` -func (c *composeService) List(context.Context, string) ([]compose.Stack, error) { - return nil, errdefs.ErrNotImplemented -} - -// Convert translate compose model into backend's native format -func (c *composeService) Convert(context.Context, *types.Project) ([]byte, error) { - return nil, errdefs.ErrNotImplemented -} diff --git a/client/containers.go b/client/containers.go deleted file mode 100644 index 41639f38..00000000 --- a/client/containers.go +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright 2020 Docker, Inc. - - 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 client - -import ( - "context" - - "github.com/docker/compose-cli/api/containers" - "github.com/docker/compose-cli/errdefs" -) - -type containerService struct { -} - -// List returns all the containers -func (c *containerService) List(context.Context, bool) ([]containers.Container, error) { - return nil, errdefs.ErrNotImplemented -} - -// Start starts a stopped container -func (c *containerService) Start(context.Context, string) error { - return errdefs.ErrNotImplemented -} - -// Stop stops the running container -func (c *containerService) Stop(context.Context, string, *uint32) error { - return errdefs.ErrNotImplemented -} - -func (c *containerService) Kill(ctx context.Context, containerID string, signal string) error { - return errdefs.ErrNotImplemented -} - -// Run creates and starts a container -func (c *containerService) Run(context.Context, containers.ContainerConfig) error { - return errdefs.ErrNotImplemented -} - -// Exec executes a command inside a running container -func (c *containerService) Exec(context.Context, string, containers.ExecRequest) error { - return errdefs.ErrNotImplemented -} - -// Logs returns all the logs of a container -func (c *containerService) Logs(context.Context, string, containers.LogsRequest) error { - return errdefs.ErrNotImplemented -} - -// Delete removes containers -func (c *containerService) Delete(context.Context, string, containers.DeleteRequest) error { - return errdefs.ErrNotImplemented -} - -// Inspect get a specific container -func (c *containerService) Inspect(context.Context, string) (containers.Container, error) { - return containers.Container{}, errdefs.ErrNotImplemented -} diff --git a/client/secrets.go b/client/secrets.go deleted file mode 100644 index 24a754b1..00000000 --- a/client/secrets.go +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2020 Docker, Inc. - - 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 client - -import ( - "context" - - "github.com/docker/compose-cli/api/secrets" - "github.com/docker/compose-cli/errdefs" -) - -type secretsService struct { -} - -func (s *secretsService) CreateSecret(context.Context, secrets.Secret) (string, error) { - return "", errdefs.ErrNotImplemented -} - -func (s *secretsService) InspectSecret(context.Context, string) (secrets.Secret, error) { - return secrets.Secret{}, errdefs.ErrNotImplemented -} - -func (s *secretsService) ListSecrets(context.Context) ([]secrets.Secret, error) { - return nil, errdefs.ErrNotImplemented -} - -func (s *secretsService) DeleteSecret(context.Context, string, bool) error { - return errdefs.ErrNotImplemented -} diff --git a/server/interceptor.go b/server/interceptor.go index ea3f3f8d..aa6a8043 100644 --- a/server/interceptor.go +++ b/server/interceptor.go @@ -24,7 +24,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/metadata" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/config" apicontext "github.com/docker/compose-cli/context" "github.com/docker/compose-cli/context/store" diff --git a/server/proxy/proxy.go b/server/proxy/proxy.go index cac28673..4029f37c 100644 --- a/server/proxy/proxy.go +++ b/server/proxy/proxy.go @@ -20,7 +20,7 @@ import ( "context" "sync" - "github.com/docker/compose-cli/client" + "github.com/docker/compose-cli/api/client" "github.com/docker/compose-cli/config" containersv1 "github.com/docker/compose-cli/protos/containers/v1" contextsv1 "github.com/docker/compose-cli/protos/contexts/v1" From c8824a54217d26c3496283fc9604d62ffeda107e Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Mon, 7 Sep 2020 13:26:16 +0200 Subject: [PATCH 3/3] Update labeler config Signed-off-by: Guillaume Tardif --- .github/labeler.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index c5d5ef7f..3eb48346 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -8,11 +8,7 @@ cli: - cli/**/* api: - - containers/**/* - - compose/**/* - - secrets/**/* - - server/**/* - - protos/**/* + - api/**/* ci: - .github/**/*