mirror of
https://github.com/docker/compose.git
synced 2026-08-31 06:49:15 +00:00
Fix Azure login : allow getting a backend when no corresponding context already exists with an explicit call from the login command. Will be usefull next for context creation with azure interactive things
This commit is contained in:
parent
832651b1dc
commit
01aaec2dbe
8 changed files with 84 additions and 62 deletions
|
|
@ -5,7 +5,6 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/docker/api/client"
|
||||
apicontext "github.com/docker/api/context"
|
||||
)
|
||||
|
||||
// Command returns the compose command with its child commands
|
||||
|
|
@ -24,12 +23,12 @@ func azureLoginCommand() *cobra.Command {
|
|||
azureLoginCmd := &cobra.Command{
|
||||
Use: "azure",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
ctx := apicontext.WithCurrentContext(cmd.Context(), "aci")
|
||||
c, err := client.New(ctx)
|
||||
ctx := cmd.Context()
|
||||
cs, err := client.GetCloudService(ctx, "aci")
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "cannot connect to backend")
|
||||
}
|
||||
return c.CloudService().Login(ctx, nil)
|
||||
return cs.Login(ctx, nil)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue