Skip to content

Commit 15df775

Browse files
committed
Merge pull request #249 from krancour/fix-deis-open
fix(client): fix URLs used by deis open
2 parents 4abe170 + 772f20c commit 15df775

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • client/controller/models/apps

client/controller/models/apps/apps.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010
"github.com/deis/workflow/client/controller/client"
1111
)
1212

13+
const workflowURLPrefix = "deis."
14+
1315
// List lists apps on a Deis controller.
1416
func List(c *client.Client, results int) ([]api.App, int, error) {
1517
body, count, err := c.LimitedRequest("/v2/apps/", results)
@@ -25,7 +27,7 @@ func List(c *client.Client, results int) ([]api.App, int, error) {
2527

2628
for name, app := range apps {
2729
// Add in app URL based on controller hostname, port included
28-
app.URL = fmt.Sprintf("%s.%s", app.ID, c.ControllerURL.Host)
30+
app.URL = fmt.Sprintf("%s.%s", app.ID, strings.TrimPrefix(c.ControllerURL.Host, workflowURLPrefix))
2931
apps[name] = app
3032
}
3133

@@ -58,7 +60,7 @@ func New(c *client.Client, id string) (api.App, error) {
5860
}
5961

6062
// Add in app URL based on controller hostname, port included
61-
app.URL = fmt.Sprintf("%s.%s", app.ID, c.ControllerURL.Host)
63+
app.URL = fmt.Sprintf("%s.%s", app.ID, strings.TrimPrefix(c.ControllerURL.Host, workflowURLPrefix))
6264

6365
return app, nil
6466
}
@@ -80,7 +82,7 @@ func Get(c *client.Client, appID string) (api.App, error) {
8082
}
8183

8284
// Add in app URL based on controller hostname, port included
83-
app.URL = fmt.Sprintf("%s.%s", app.ID, c.ControllerURL.Host)
85+
app.URL = fmt.Sprintf("%s.%s", app.ID, strings.TrimPrefix(c.ControllerURL.Host, workflowURLPrefix))
8486

8587
return app, nil
8688
}

0 commit comments

Comments
 (0)