mirror of https://github.com/docker/docs.git
prevent container scheduling without -c/-m
This commit is contained in:
parent
60a80c0c84
commit
42198c779e
|
@ -1,6 +1,7 @@
|
|||
package scheduler
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/docker/libcluster"
|
||||
|
@ -45,6 +46,10 @@ func (s *Scheduler) CreateContainer(config *dockerclient.ContainerConfig, name s
|
|||
s.Lock()
|
||||
defer s.Unlock()
|
||||
|
||||
if config.Memory == 0 || config.CpuShares == 0 {
|
||||
return nil, fmt.Errorf("Creating containers in clustering mode requires resource constraints (-c and -m) to be set")
|
||||
}
|
||||
|
||||
node, err := s.selectNodeForContainer(config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in New Issue