Add new UCP image

This commit is contained in:
Marcos Lilljedahl
2017-07-28 18:01:23 -03:00
parent a6fdfcaa7d
commit f82286d1d1
2 changed files with 13 additions and 2 deletions

View File

@@ -283,12 +283,19 @@ func (p *pwd) InstanceAllowedImages() []string {
return []string{
config.GetDindImageName(),
"franela/dind:overlay2-dev",
"franela/ucp:2.4.1",
"franela/ucp:2.1.5",
}
}
func (p *pwd) InstanceExec(instance *types.Instance, cmd []string) (int, error) {
defer observeAction("InstanceExec", time.Now())
return p.docker.Exec(instance.Name, cmd)
b := bytes.NewBufferString("")
if c, err := p.docker.ExecAttach(instance.Name, cmd, b); c > 0 {
log.Println(b.String())
return c, fmt.Errorf("Error %d running command [%s]", c, cmd)
} else if err != nil {
return -1, err
}
return 0, nil
}

View File

@@ -186,6 +186,10 @@ func (p *pwd) SessionGet(sessionId string) *types.Session {
s, _ := p.storage.SessionGet(sessionId)
if s == nil {
return nil
}
if err := p.prepareSession(s); err != nil {
log.Println(err)
return nil