refactor!: server add/rm has better UI/UX

Less confusing logging messages, clear "is created" / "already exists"
output. Move the majority of logging to debug output to not confuse the
situation. Some code cleanups also in there.
This commit is contained in:
2024-06-25 09:48:53 +02:00
parent 1a12bef53e
commit 7b7e1bfa97
4 changed files with 63 additions and 48 deletions

View File

@ -75,9 +75,9 @@ func New(serverName string) (*client.Client, error) {
if info.Swarm.LocalNodeState == "inactive" {
if serverName != "default" {
return cl, fmt.Errorf("swarm mode not enabled on %s?", serverName)
} else {
return cl, errors.New("swarm mode not enabled on local server?")
}
return cl, errors.New("swarm mode not enabled on local server?")
}
return cl, nil