Skip to content

Commit

Permalink
Merge pull request flynn#1420 from flynn/fix-sticky
Browse files Browse the repository at this point in the history
Fix sticky route flag
  • Loading branch information
titanous committed Apr 7, 2015
2 parents 437f043 + bb79ef0 commit e5e1681
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func runRouteAddHTTP(args *docopt.Args, client *controller.Client) error {
Domain: args.String["<domain>"],
TLSCert: string(tlsCert),
TLSKey: string(tlsKey),
Sticky: args.Bool["sticky"],
Sticky: args.Bool["--sticky"],
}
route := hr.ToRoute()
if err := client.CreateRoute(mustApp(), route); err != nil {
Expand Down
15 changes: 14 additions & 1 deletion test/test_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,24 @@ func (s *CLISuite) TestRoute(t *c.C) {

// flynn route add http
route := random.String(32) + ".dev"
newRoute := app.flynn("route", "add", "http", route)
newRoute := app.flynn("route", "add", "http", "--sticky", route)
t.Assert(newRoute, Succeeds)
routeID := strings.TrimSpace(newRoute.Output)
assertRouteContains(routeID, true)

// ensure sticky flag is set
routes, err := s.controllerClient(t).RouteList(app.name)
t.Assert(err, c.IsNil)
var found bool
for _, r := range routes {
if fmt.Sprintf("%s/%s", r.Type, r.ID) != routeID {
continue
}
t.Assert(r.Sticky, c.Equals, true)
found = true
}
t.Assert(found, c.Equals, true, c.Commentf("didn't find route"))

// flynn route remove
t.Assert(app.flynn("route", "remove", routeID), Succeeds)
assertRouteContains(routeID, false)
Expand Down

0 comments on commit e5e1681

Please sign in to comment.