Skip to content
This repository was archived by the owner on Apr 17, 2019. It is now read-only.

Commit c99db95

Browse files
committed
Merge pull request #898 from aledbf/sort-locations
NGINX Ingress controller Sort locations
2 parents 0068579 + d229b99 commit c99db95

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ingress/controllers/nginx/nginx/nginx.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,13 @@ type Location struct {
8888
}
8989

9090
// LocationByPath sorts location by path
91+
// Location / is the last one
9192
type LocationByPath []*Location
9293

9394
func (c LocationByPath) Len() int { return len(c) }
9495
func (c LocationByPath) Swap(i, j int) { c[i], c[j] = c[j], c[i] }
9596
func (c LocationByPath) Less(i, j int) bool {
96-
return c[i].Path < c[j].Path
97+
return c[i].Path > c[j].Path
9798
}
9899

99100
// NewDefaultServer return an UpstreamServer to be use as default server that returns 503.

0 commit comments

Comments
 (0)