@@ -40,8 +40,6 @@ import (
4040 "github.com/docker/cli/cli/command"
4141 "github.com/docker/cli/pkg/kvfile"
4242 "github.com/docker/compose/v2/cmd/formatter"
43- "github.com/docker/compose/v2/internal/desktop"
44- "github.com/docker/compose/v2/internal/experimental"
4543 "github.com/docker/compose/v2/internal/tracing"
4644 "github.com/docker/compose/v2/pkg/api"
4745 ui "github.com/docker/compose/v2/pkg/progress"
@@ -91,14 +89,6 @@ func init() {
9189 dotenv .RegisterFormat ("raw" , rawEnv )
9290}
9391
94- type Backend interface {
95- api.Service
96-
97- SetDesktopClient (cli * desktop.Client )
98-
99- SetExperiments (experiments * experimental.State )
100- }
101-
10292// Command defines a compose CLI command as a func with args
10393type Command func (context.Context , []string ) error
10494
@@ -426,7 +416,7 @@ func RunningAsStandalone() bool {
426416}
427417
428418// RootCommand returns the compose command with its child commands
429- func RootCommand (dockerCli command.Cli , backend Backend ) * cobra.Command { //nolint:gocyclo
419+ func RootCommand (dockerCli command.Cli , backend api. Service ) * cobra.Command { //nolint:gocyclo
430420 // filter out useless commandConn.CloseWrite warning message that can occur
431421 // when using a remote context that is unreachable: "commandConn.CloseWrite: commandconn: failed to wait: signal: killed"
432422 // https://github.com/docker/cli/blob/e1f24d3c93df6752d3c27c8d61d18260f141310c/cli/connhelper/commandconn/commandconn.go#L203-L215
@@ -437,7 +427,6 @@ func RootCommand(dockerCli command.Cli, backend Backend) *cobra.Command { //noli
437427 "commandConn.CloseRead:" ,
438428 ))
439429
440- experiments := experimental .NewState ()
441430 opts := ProjectOptions {}
442431 var (
443432 ansi string
@@ -581,27 +570,6 @@ func RootCommand(dockerCli command.Cli, backend Backend) *cobra.Command { //noli
581570 }
582571 cmd .SetContext (ctx )
583572
584- // (6) Desktop integration
585- var desktopCli * desktop.Client
586- if ! dryRun {
587- if desktopCli , err = desktop .NewFromDockerClient (ctx , dockerCli ); desktopCli != nil {
588- logrus .Debugf ("Enabled Docker Desktop integration (experimental) @ %s" , desktopCli .Endpoint ())
589- backend .SetDesktopClient (desktopCli )
590- } else if err != nil {
591- // not fatal, Compose will still work but behave as though
592- // it's not running as part of Docker Desktop
593- logrus .Debugf ("failed to enable Docker Desktop integration: %v" , err )
594- } else {
595- logrus .Trace ("Docker Desktop integration not enabled" )
596- }
597- }
598-
599- // (7) experimental features
600- if err := experiments .Load (ctx , desktopCli ); err != nil {
601- logrus .Debugf ("Failed to query feature flags from Desktop: %v" , err )
602- }
603- backend .SetExperiments (experiments )
604-
605573 return nil
606574 },
607575 }
@@ -715,15 +683,3 @@ var printerModes = []string{
715683 ui .ModeJSON ,
716684 ui .ModeQuiet ,
717685}
718-
719- func SetUnchangedOption (name string , experimentalFlag bool ) bool {
720- var value bool
721- // If the var is defined we use that value first
722- if envVar , ok := os .LookupEnv (name ); ok {
723- value = utils .StringToBool (envVar )
724- } else {
725- // if not, we try to get it from experimental feature flag
726- value = experimentalFlag
727- }
728- return value
729- }
0 commit comments