refactor: drop swarm checking code for now
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Part of coop-cloud/go-abra#57.
This commit is contained in:
parent
56796cf768
commit
dc616fd3a0
|
@ -93,32 +93,6 @@ func GetAllDeployedServices(contextName string) StackStatus {
|
|||
return StackStatus{services, nil}
|
||||
}
|
||||
|
||||
func checkDaemonIsSwarmManager(contextName string) error {
|
||||
cl, err := abraClient.NewClientWithContext(contextName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
info, err := cl.Info(context.Background())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !info.Swarm.ControlAvailable {
|
||||
return errors.New("this server is not a swarm manager. Did you run \"abra server init\"?")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func checkDaemonIsSwarmManagerViaClient(ctx context.Context, cl *dockerclient.Client) error {
|
||||
info, err := cl.Info(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !info.Swarm.ControlAvailable {
|
||||
return errors.New("this node is not a swarm manager. Use \"docker swarm init\" or \"docker swarm join\" to connect this node to swarm and try again")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// validateStackName checks if the provided string is a valid stack name (namespace).
|
||||
// It currently only does a rudimentary check if the string is empty, or consists
|
||||
// of only whitespace and quoting characters.
|
||||
|
@ -185,10 +159,6 @@ func validateResolveImageFlag(opts *Deploy) error {
|
|||
}
|
||||
|
||||
func deployCompose(ctx context.Context, cl *dockerclient.Client, opts Deploy, config *composetypes.Config) error {
|
||||
if err := checkDaemonIsSwarmManagerViaClient(ctx, cl); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
namespace := convert.NewNamespace(opts.Namespace)
|
||||
|
||||
if opts.Prune {
|
||||
|
|
Loading…
Reference in New Issue