diff --git a/containers/types.go b/containers/types.go index 25fc484..3c0454f 100644 --- a/containers/types.go +++ b/containers/types.go @@ -2,6 +2,7 @@ package containers import ( "errors" + "fmt" "log" "path" "strings" @@ -340,7 +341,18 @@ func (c *Container) GetTechs() (apps.AppTechs, error) { driver := c.getDriver() - stdouterr, err := driver.Exec(c.App.Name, []string{"ls", "/opt/techs"}, "", []string{}, true) + stdouterr, err := driver.Exec(c.App.Name, []string{"ls", "/opt"}, "", []string{}, true) + if err != nil { + // in case there is an error just return empty response + return techs, nil + } + + // Check if /opt/techs exists + if !strings.Contains(string(*stdouterr), "techs") { + return techs, nil + } + + stdouterr, err = driver.Exec(c.App.Name, []string{"ls", "/opt/techs"}, "", []string{}, true) if err != nil { // in case there is an error just return empty response return techs, nil @@ -360,7 +372,7 @@ func (c *Container) GetTechs() (apps.AppTechs, error) { Version: techParts[1], }) } else { - return techs, errors.New("one of the tech has wrong number of parts") + return techs, fmt.Errorf("one of the tech has wrong number of parts (%s)", techRaw) } }