瀏覽代碼

move context cmd to its own folder ; initial `docker context login` command

Guillaume Tardif 5 年之前
父節點
當前提交
eea84cd487
共有 2 個文件被更改,包括 30 次插入0 次删除
  1. 2 0
      cli/cmd/context/context.go
  2. 28 0
      cli/cmd/context/login/login.go

+ 2 - 0
cli/cmd/context/context.go

@@ -28,6 +28,7 @@
 package context
 
 import (
+	"github.com/docker/api/cli/cmd/context/login"
 	"github.com/spf13/cobra"
 
 	cliopts "github.com/docker/api/cli/options"
@@ -45,6 +46,7 @@ func Command(opts *cliopts.GlobalOpts) *cobra.Command {
 		listCommand(),
 		removeCommand(),
 		useCommand(opts),
+		login.Command(),
 	)
 
 	return cmd

+ 28 - 0
cli/cmd/context/login/login.go

@@ -0,0 +1,28 @@
+package login
+
+import (
+	"github.com/spf13/cobra"
+)
+
+// Command returns the compose command with its child commands
+func Command() *cobra.Command {
+	command := &cobra.Command{
+		Short: "Cloud login for docker contexts",
+		Use:   "login",
+	}
+	command.AddCommand(
+		azureLoginCommand(),
+	)
+	return command
+}
+
+func azureLoginCommand() *cobra.Command {
+	azureLoginCmd := &cobra.Command{
+		Use: "azure",
+		RunE: func(cmd *cobra.Command, args []string) error {
+			return nil
+		},
+	}
+
+	return azureLoginCmd
+}