Instances in a session should be created sequentially

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-06-09 10:18:30 -03:00
parent f14e3a137d
commit 84b532b887
2 changed files with 46 additions and 0 deletions

View File

@@ -192,6 +192,9 @@ func (p *pwd) checkHostnameExists(session *Session, hostname string) bool {
}
func (p *pwd) InstanceNew(session *Session, conf InstanceConfig) (*Instance, error) {
session.rw.Lock()
defer session.rw.Unlock()
if conf.ImageName == "" {
conf.ImageName = config.GetDindImageName()
}