fix: drop swarmkit/etcd dep
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Part of coop-cloud/go-abra#57.
This commit is contained in:
@ -7,7 +7,6 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/cli/cli/command/stack/options"
|
||||
"github.com/docker/cli/cli/compose/loader"
|
||||
"github.com/docker/cli/cli/compose/schema"
|
||||
composetypes "github.com/docker/cli/cli/compose/types"
|
||||
@ -15,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
// LoadComposefile parse the composefile specified in the cli and returns its Config and version.
|
||||
func LoadComposefile(opts options.Deploy, appEnv map[string]string) (*composetypes.Config, error) {
|
||||
func LoadComposefile(opts Deploy, appEnv map[string]string) (*composetypes.Config, error) {
|
||||
configDetails, err := getConfigDetails(opts.Composefiles, appEnv)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
15
client/stack/options.go
Normal file
15
client/stack/options.go
Normal file
@ -0,0 +1,15 @@
|
||||
package stack
|
||||
|
||||
// Deploy holds docker stack deploy options
|
||||
type Deploy struct {
|
||||
Composefiles []string
|
||||
Namespace string
|
||||
ResolveImage string
|
||||
SendRegistryAuth bool
|
||||
Prune bool
|
||||
}
|
||||
|
||||
// Remove holds docker stack remove options
|
||||
type Remove struct {
|
||||
Namespaces []string
|
||||
}
|
@ -6,7 +6,6 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/cli/cli/command/stack/options"
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/api/types/versions"
|
||||
@ -16,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
// RunRemove is the swarm implementation of docker stack remove
|
||||
func RunRemove(ctx context.Context, client *apiclient.Client, opts options.Remove) error {
|
||||
func RunRemove(ctx context.Context, client *apiclient.Client, opts Remove) error {
|
||||
var errs []string
|
||||
for _, namespace := range opts.Namespaces {
|
||||
services, err := getStackServices(ctx, client, namespace)
|
||||
|
@ -7,8 +7,7 @@ import (
|
||||
"unicode"
|
||||
|
||||
abraClient "coopcloud.tech/abra/client"
|
||||
"github.com/docker/cli/cli/command/stack/options"
|
||||
"github.com/docker/cli/cli/compose/convert"
|
||||
"coopcloud.tech/abra/client/convert"
|
||||
composetypes "github.com/docker/cli/cli/compose/types"
|
||||
"github.com/docker/cli/opts"
|
||||
"github.com/docker/docker/api/types"
|
||||
@ -161,7 +160,7 @@ const (
|
||||
)
|
||||
|
||||
// RunDeploy is the swarm implementation of docker stack deploy
|
||||
func RunDeploy(cl *apiclient.Client, opts options.Deploy, cfg *composetypes.Config) error {
|
||||
func RunDeploy(cl *apiclient.Client, opts Deploy, cfg *composetypes.Config) error {
|
||||
ctx := context.Background()
|
||||
|
||||
if err := validateResolveImageFlag(&opts); err != nil {
|
||||
@ -177,7 +176,7 @@ func RunDeploy(cl *apiclient.Client, opts options.Deploy, cfg *composetypes.Conf
|
||||
}
|
||||
|
||||
// validateResolveImageFlag validates the opts.resolveImage command line option
|
||||
func validateResolveImageFlag(opts *options.Deploy) error {
|
||||
func validateResolveImageFlag(opts *Deploy) error {
|
||||
switch opts.ResolveImage {
|
||||
case ResolveImageAlways, ResolveImageChanged, ResolveImageNever:
|
||||
return nil
|
||||
@ -186,7 +185,7 @@ func validateResolveImageFlag(opts *options.Deploy) error {
|
||||
}
|
||||
}
|
||||
|
||||
func deployCompose(ctx context.Context, cl *apiclient.Client, opts options.Deploy, config *composetypes.Config) error {
|
||||
func deployCompose(ctx context.Context, cl *apiclient.Client, opts Deploy, config *composetypes.Config) error {
|
||||
if err := checkDaemonIsSwarmManagerViaClient(ctx, cl); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user