fix: log correctly on provisioning

This commit is contained in:
decentral1se 2021-10-26 01:30:23 +02:00
parent 066b2b9373
commit b3496ad286
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -247,19 +247,21 @@ func initSwarmLocal(c *cli.Context, cl *dockerClient.Client, domainName string)
if !strings.Contains(err.Error(), "is already part of a swarm") {
return err
}
logrus.Info("swarm mode already initialised on local server")
} else {
logrus.Infof("initialised swarm mode on local server")
}
logrus.Infof("initialised swarm mode on local server")
netOpts := types.NetworkCreate{Driver: "overlay", Scope: "swarm"}
if _, err := cl.NetworkCreate(c.Context, "proxy", netOpts); err != nil {
if !strings.Contains(err.Error(), "is already part of a swarm") {
if !strings.Contains(err.Error(), "proxy already exists") {
return err
}
logrus.Info("swarm overlay network already created on local server")
} else {
logrus.Infof("swarm overlay network created on local server")
}
logrus.Infof("swarm overlay network created on local server")
return nil
}
@ -299,19 +301,21 @@ func initSwarm(c *cli.Context, cl *dockerClient.Client, domainName string) error
if !strings.Contains(err.Error(), "is already part of a swarm") {
return err
}
logrus.Info("swarm mode already initialised on %s", domainName)
} else {
logrus.Infof("initialised swarm mode on %s", domainName)
}
logrus.Infof("initialised swarm mode on %s", domainName)
netOpts := types.NetworkCreate{Driver: "overlay", Scope: "swarm"}
if _, err := cl.NetworkCreate(c.Context, "proxy", netOpts); err != nil {
if !strings.Contains(err.Error(), "is already part of a swarm") {
if !strings.Contains(err.Error(), "proxy already exists") {
return err
}
logrus.Infof("swarm overlay network already created on %s", domainName)
} else {
logrus.Infof("swarm overlay network created on %s", domainName)
}
logrus.Infof("swarm overlay network created on %s", domainName)
return nil
}