Make sure not to treat the instance as a docker host always, as it might

not be one.
This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-05-29 10:19:01 -03:00
parent b0b9269ccc
commit 2e63e541f3
6 changed files with 47 additions and 33 deletions

View File

@@ -10,6 +10,9 @@ type checkSwarmStatusTask struct {
}
func (c checkSwarmStatusTask) Run(i *Instance) error {
if i.docker == nil {
return nil
}
if info, err := i.docker.GetDaemonInfo(); err == nil {
if info.Swarm.LocalNodeState != swarm.LocalNodeStateInactive && info.Swarm.LocalNodeState != swarm.LocalNodeStateLocked {
i.IsManager = &info.Swarm.ControlAvailable