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

This commit is contained in:
Guillaume Tardif 2020-05-11 14:39:43 +02:00
parent 230cccff76
commit eea84cd487
2 changed files with 30 additions and 0 deletions

View File

@ -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

View File

@ -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
}