diff --git a/containers/types.go b/containers/types.go index 3c0454f..158a700 100644 --- a/containers/types.go +++ b/containers/types.go @@ -263,11 +263,15 @@ func (c *Container) SetTechnology(tech string, version string) error { var err error // TODO: script injection here? + var output *[]byte if version == "" { - _, err = driver.Exec(c.App.Name, []string{"su", "app", "-c", "rosti " + tech}, "", []string{}, false) + output, err = driver.Exec(c.App.Name, []string{"su", "app", "-c", "rosti " + tech}, "", []string{}, false) } else { - _, err = driver.Exec(c.App.Name, []string{"su", "app", "-c", "rosti " + tech + " " + version}, "", []string{}, false) + output, err = driver.Exec(c.App.Name, []string{"su", "app", "-c", "rosti " + tech + " " + version}, "", []string{}, false) } + + log.Printf("DEBUG: enable tech for %s output: %s", c.App.Name, string(*output)) + return err } diff --git a/glue/main.go b/glue/main.go index 550a35e..d51f0f2 100644 --- a/glue/main.go +++ b/glue/main.go @@ -15,6 +15,9 @@ import ( "github.com/rosti-cz/node-api/node" ) +// Wait for the container a little bit longer +const ENABLE_TECH_WAIT = 10 + // Processor separates logic of apps, containers, detector and node from handlers. // It defines common interface for both types of handlers, HTTP and the events. type Processor struct { @@ -455,6 +458,8 @@ func (p *Processor) EnableTech(service, version string) error { return err } + time.Sleep(ENABLE_TECH_WAIT * time.Second) + container, err := p.getContainer() if err != nil { return err