Skip to content

Commit bb8bbbe

Browse files
Merge pull request #19076 from jmprusi/master
Fix for wildcard routes taking precedence over other routes
2 parents effec6b + 9120e05 commit bb8bbbe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

images/router/haproxy/reload-haproxy

+5-1
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ retries=20
7373

7474

7575
# sort the path based map files for the haproxy map_beg function
76+
# Leaving any wildcard route at the end of the resulting file,
77+
# See https://github.com/openshift/origin/issues/16724 for more details.
7678
for mapfile in "$haproxy_conf_dir"/*.map; do
77-
sort -r "$mapfile" -o "$mapfile"
79+
grep -v -F '^[^\.]*\' "$mapfile" | sort -r -o "/tmp/$mapfile"
80+
grep -F '^[^\.]*\' "$mapfile" | sort -r >> "/tmp/$mapfile"
81+
mv -f "/tmp/$mapfile" "$haproxy_conf_dir/$mapfile"
7882
done
7983

8084
old_pids=$(ps -A -opid,args | grep haproxy | egrep -v -e 'grep|reload-haproxy' | awk '{print $1}' | tr '\n' ' ')

0 commit comments

Comments
 (0)