diff --git a/cmd/compose/compose.go b/cmd/compose/compose.go index 2be3ab157..9bd3a3533 100644 --- a/cmd/compose/compose.go +++ b/cmd/compose/compose.go @@ -36,7 +36,7 @@ import ( composegoutils "github.com/compose-spec/compose-go/v2/utils" "github.com/docker/buildx/util/logutil" dockercli "github.com/docker/cli/cli" - "github.com/docker/cli/cli-plugins/manager" + "github.com/docker/cli/cli-plugins/metadata" "github.com/docker/cli/cli/command" "github.com/docker/cli/pkg/kvfile" "github.com/docker/compose/v2/cmd/formatter" @@ -416,7 +416,7 @@ const PluginName = "compose" // RunningAsStandalone detects when running as a standalone program func RunningAsStandalone() bool { - return len(os.Args) < 2 || os.Args[1] != manager.MetadataSubcommandName && os.Args[1] != PluginName + return len(os.Args) < 2 || os.Args[1] != metadata.MetadataSubcommandName && os.Args[1] != PluginName } // RootCommand returns the compose command with its child commands diff --git a/cmd/main.go b/cmd/main.go index 583702708..3c3e2290e 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -20,7 +20,7 @@ import ( "os" dockercli "github.com/docker/cli/cli" - "github.com/docker/cli/cli-plugins/manager" + "github.com/docker/cli/cli-plugins/metadata" "github.com/docker/cli/cli-plugins/plugin" "github.com/docker/cli/cli/command" "github.com/docker/compose/v2/cmd/cmdtrace" @@ -68,7 +68,7 @@ func pluginMain() { }) return cmd }, - manager.Metadata{ + metadata.Metadata{ SchemaVersion: "0.1.0", Vendor: "Docker Inc.", Version: internal.Version, diff --git a/pkg/compose/build_bake.go b/pkg/compose/build_bake.go index 32e8e9200..165e5e54d 100644 --- a/pkg/compose/build_bake.go +++ b/pkg/compose/build_bake.go @@ -34,6 +34,7 @@ import ( "strings" "github.com/compose-spec/compose-go/v2/types" + "github.com/containerd/errdefs" "github.com/docker/cli/cli-plugins/manager" "github.com/docker/cli/cli/command" "github.com/docker/compose/v2/pkg/api" @@ -75,7 +76,7 @@ func buildWithBake(dockerCli command.Cli) (bool, error) { _, err = manager.GetPlugin("buildx", dockerCli, &cobra.Command{}) if err != nil { - if manager.IsNotFound(err) { + if errdefs.IsNotFound(err) { logrus.Warnf("Docker Compose is configured to build using Bake, but buildx isn't installed") return false, nil } diff --git a/pkg/compose/plugins.go b/pkg/compose/plugins.go index 0e6bd12d8..abb4e4fda 100644 --- a/pkg/compose/plugins.go +++ b/pkg/compose/plugins.go @@ -30,6 +30,7 @@ import ( "sync" "github.com/compose-spec/compose-go/v2/types" + "github.com/containerd/errdefs" "github.com/docker/cli/cli-plugins/manager" "github.com/docker/cli/cli/config" "github.com/docker/compose/v2/pkg/progress" @@ -163,7 +164,7 @@ func (s *composeService) getPluginBinaryPath(provider string) (path string, err if err == nil { path = plugin.Path } - if manager.IsNotFound(err) { + if errdefs.IsNotFound(err) { path, err = exec.LookPath(executable(provider)) } return path, err diff --git a/pkg/compose/shellout.go b/pkg/compose/shellout.go index 97e61f05c..18615cb50 100644 --- a/pkg/compose/shellout.go +++ b/pkg/compose/shellout.go @@ -21,7 +21,7 @@ import ( "os/exec" "github.com/compose-spec/compose-go/v2/types" - "github.com/docker/cli/cli-plugins/manager" + "github.com/docker/cli/cli-plugins/metadata" "github.com/docker/cli/cli/context/docker" "github.com/docker/compose/v2/internal" "go.opentelemetry.io/otel" @@ -32,7 +32,7 @@ import ( func (s *composeService) prepareShellOut(gctx context.Context, env types.Mapping, cmd *exec.Cmd) error { env = env.Clone() // remove DOCKER_CLI_PLUGIN... variable so a docker-cli plugin will detect it run standalone - delete(env, manager.ReexecEnvvar) + delete(env, metadata.ReexecEnvvar) // propagate opentelemetry context to child process, see https://github.com/open-telemetry/oteps/blob/main/text/0258-env-context-baggage-carriers.md carrier := propagation.MapCarrier{} @@ -42,11 +42,11 @@ func (s *composeService) prepareShellOut(gctx context.Context, env types.Mapping env["DOCKER_CONTEXT"] = s.dockerCli.CurrentContext() env["USER_AGENT"] = "compose/" + internal.Version - metadata, err := s.dockerCli.ContextStore().GetMetadata(s.dockerCli.CurrentContext()) + md, err := s.dockerCli.ContextStore().GetMetadata(s.dockerCli.CurrentContext()) if err != nil { return err } - endpoint, err := docker.EndpointFromContext(metadata) + endpoint, err := docker.EndpointFromContext(md) if err != nil { return err }