mirror of
https://github.com/docker/compose.git
synced 2026-08-28 04:18:05 +00:00
Renamed docker-classic to “com.docker.com”.
This commit is contained in:
parent
5103d54330
commit
bbcdad39d5
18 changed files with 53 additions and 46 deletions
|
|
@ -32,7 +32,7 @@ import (
|
|||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/docker/api/cli/dockerclassic"
|
||||
"github.com/docker/api/cli/mobycli"
|
||||
"github.com/docker/api/context/store"
|
||||
)
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ $ docker context create my-context --description "some description" --docker "ho
|
|||
Use: "create CONTEXT",
|
||||
Short: "Create new context",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return dockerclassic.ExecCmd(cmd)
|
||||
return mobycli.ExecCmd(cmd)
|
||||
},
|
||||
Long: longHelp,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
package context
|
||||
|
||||
import (
|
||||
"github.com/docker/api/cli/dockerclassic"
|
||||
"github.com/docker/api/cli/mobycli"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
|
@ -39,7 +39,7 @@ func inspectCommand() *cobra.Command {
|
|||
Short: "Display detailed information on one or more contexts",
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return dockerclassic.ExecCmd(cmd)
|
||||
return mobycli.ExecCmd(cmd)
|
||||
},
|
||||
}
|
||||
return cmd
|
||||
|
|
|
|||
|
|
@ -32,10 +32,11 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
apicontext "github.com/docker/api/context"
|
||||
"github.com/docker/api/context/store"
|
||||
"github.com/docker/api/multierror"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
type removeOpts struct {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import (
|
|||
"github.com/pkg/errors"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/docker/api/cli/dockerclassic"
|
||||
"github.com/docker/api/cli/mobycli"
|
||||
"github.com/docker/api/client"
|
||||
"github.com/docker/api/errdefs"
|
||||
)
|
||||
|
|
@ -22,7 +22,7 @@ func Command() *cobra.Command {
|
|||
Args: cobra.MaximumNArgs(1),
|
||||
RunE: runLogin,
|
||||
}
|
||||
// define flags for backward compatibility with docker-classic
|
||||
// define flags for backward compatibility with com.docker.cli
|
||||
flags := cmd.Flags()
|
||||
flags.StringP("username", "u", "", "Username")
|
||||
flags.StringP("password", "p", "", "Password")
|
||||
|
|
@ -41,7 +41,7 @@ func runLogin(cmd *cobra.Command, args []string) error {
|
|||
return errors.New("unknown backend type for cloud login: " + backend)
|
||||
}
|
||||
}
|
||||
return dockerclassic.ExecCmd(cmd)
|
||||
return mobycli.ExecCmd(cmd)
|
||||
}
|
||||
|
||||
func cloudLogin(cmd *cobra.Command, backendType string) error {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import (
|
|||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/docker/api/cli/dockerclassic"
|
||||
"github.com/docker/api/cli/mobycli"
|
||||
)
|
||||
|
||||
const cliVersion = "0.1.0"
|
||||
|
|
@ -19,7 +19,7 @@ func VersionCommand() *cobra.Command {
|
|||
Args: cobra.MaximumNArgs(0),
|
||||
RunE: runVersion,
|
||||
}
|
||||
// define flags for backward compatibility with docker-classic
|
||||
// define flags for backward compatibility with com.docker.cli
|
||||
flags := cmd.Flags()
|
||||
flags.String("format", "", "Format the output using the given Go template")
|
||||
flags.String("kubeconfig", "", "Kubernetes config file")
|
||||
|
|
@ -28,11 +28,11 @@ func VersionCommand() *cobra.Command {
|
|||
}
|
||||
|
||||
func runVersion(cmd *cobra.Command, args []string) error {
|
||||
versionResult, _ := dockerclassic.ExecSilent(cmd.Context())
|
||||
versionResult, _ := mobycli.ExecSilent(cmd.Context())
|
||||
// we don't want to fail on error, there is an error if the engine is not available but it displays client version info
|
||||
// Still, technically the [] byte versionResult could be nil, just let the original command display what it has to display
|
||||
if versionResult == nil {
|
||||
return dockerclassic.ExecCmd(cmd)
|
||||
return mobycli.ExecCmd(cmd)
|
||||
}
|
||||
var s string = string(versionResult)
|
||||
fmt.Print(strings.Replace(s, "\n Version:", "\n Azure integration "+cliVersion+"\n Version:", 1))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue