mirror of
https://github.com/docker/compose.git
synced 2026-08-31 23:03:55 +00:00
Move the struct for creating and aci context to azure package
This commit is contained in:
parent
43b54ef75a
commit
84dbd1467d
5 changed files with 26 additions and 31 deletions
|
|
@ -22,21 +22,14 @@ import (
|
|||
"github.com/pkg/errors"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/docker/api/azure"
|
||||
"github.com/docker/api/client"
|
||||
"github.com/docker/api/context/store"
|
||||
"github.com/docker/api/errdefs"
|
||||
)
|
||||
|
||||
// AciCreateOpts options for creating ACI context
|
||||
type AciCreateOpts struct {
|
||||
Description string
|
||||
Location string
|
||||
SubscriptionID string
|
||||
ResourceGroup string
|
||||
}
|
||||
|
||||
func createAciCommand() *cobra.Command {
|
||||
var opts AciCreateOpts
|
||||
var opts azure.ContextParams
|
||||
cmd := &cobra.Command{
|
||||
Use: "aci CONTEXT [flags]",
|
||||
Short: "Create a context for Azure Container Instances",
|
||||
|
|
@ -54,7 +47,7 @@ func createAciCommand() *cobra.Command {
|
|||
return cmd
|
||||
}
|
||||
|
||||
func runCreateAci(ctx context.Context, contextName string, opts AciCreateOpts) error {
|
||||
func runCreateAci(ctx context.Context, contextName string, opts azure.ContextParams) error {
|
||||
if contextExists(ctx, contextName) {
|
||||
return errors.Wrapf(errdefs.ErrAlreadyExists, "context %s", contextName)
|
||||
}
|
||||
|
|
@ -66,7 +59,7 @@ func runCreateAci(ctx context.Context, contextName string, opts AciCreateOpts) e
|
|||
|
||||
}
|
||||
|
||||
func getAciContextData(ctx context.Context, opts AciCreateOpts) (interface{}, string, error) {
|
||||
func getAciContextData(ctx context.Context, opts azure.ContextParams) (interface{}, string, error) {
|
||||
cs, err := client.GetCloudService(ctx, store.AciContextType)
|
||||
if err != nil {
|
||||
return nil, "", errors.Wrap(err, "cannot connect to ACI backend")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue