mirror of
https://github.com/spaytac/orbiter.git
synced 2026-01-21 23:44:41 +00:00
Merge pull request #35 from gianarb/hotfix/fixed-messages
Fixed bad messages syntax
This commit is contained in:
commit
35dbe63ec8
@ -66,7 +66,7 @@ func (p SwarmProvider) Scale(serviceId string, target int, direction bool) error
|
|||||||
logrus.WithFields(logrus.Fields{
|
logrus.WithFields(logrus.Fields{
|
||||||
"error": err.Error(),
|
"error": err.Error(),
|
||||||
"provider": "swarm",
|
"provider": "swarm",
|
||||||
}).Info("Service %s is not scaling.", serviceId)
|
}).Infof("Service %s is not scaling.", serviceId)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ func (p SwarmProvider) Scale(serviceId string, target int, direction bool) error
|
|||||||
|
|
||||||
// This function validate if a request is acceptable or not.
|
// This function validate if a request is acceptable or not.
|
||||||
func (p *SwarmProvider) isAcceptable(tasks []swarm.Task, target int, direction bool) error {
|
func (p *SwarmProvider) isAcceptable(tasks []swarm.Task, target int, direction bool) error {
|
||||||
if p.calculateActiveTasks(tasks) < target || p.calculateActiveTasks(tasks) < 2 && direction == false {
|
if direction == false && (p.calculateActiveTasks(tasks) < target || p.calculateActiveTasks(tasks) < 2) {
|
||||||
return errors.New(fmt.Sprintf("I can not scale down because it has only %d running.", target))
|
return errors.New(fmt.Sprintf("I can not scale down because it has only %d running.", target))
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user