refactor: drop swarm checking code for now
continuous-integration/drone/push Build is passing Details

Part of coop-cloud/go-abra#57.
This commit is contained in:
decentral1se 2021-09-04 21:19:34 +02:00
parent 56796cf768
commit dc616fd3a0
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 0 additions and 30 deletions

View File

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