feat: debug logging

Closes coop-cloud/organising#164.
This commit is contained in:
2021-09-11 00:54:02 +02:00
parent 27d665c3be
commit 9fcdc45851
38 changed files with 305 additions and 95 deletions

View File

@ -21,7 +21,7 @@ var serverInitCommand = &cli.Command{
HideHelp: true,
ArgsUsage: "<domain>",
Description: `
Initialise swarm mode on the target <server>.
Initialise swarm mode on the target <domain>.
This initialisation explicitly chooses the "single host swarm" mode which uses
the default IPv4 address as the advertising address. This can be re-configured
@ -45,6 +45,7 @@ later for more advanced use cases.
return d.DialContext(ctx, "udp", "95.216.24.230:53")
},
}
logrus.Debugf("created DNS resolver via 95.216.24.230")
ctx := context.Background()
ips, err := resolver.LookupIPAddr(ctx, domainName)
@ -64,11 +65,13 @@ later for more advanced use cases.
if _, err := cl.SwarmInit(ctx, initReq); err != nil {
return err
}
logrus.Debugf("initialised swarm on '%s'", domainName)
netOpts := types.NetworkCreate{Driver: "overlay", Scope: "swarm"}
if _, err := cl.NetworkCreate(ctx, "proxy", netOpts); err != nil {
return err
}
logrus.Debug("swarm overlay network 'proxy' created")
return nil
},