LB routing rules

There is a issue on github for this:

In a comment @alena says it would break backwards compatibility.

Well, I just ran into this issue, and the work-around is not so nice (when there are many services you want to keep out of the default backend section), and it makes me wonder, what compatibility is broken, if I have a routing rule that looks like this:

Why can’t that be the only services in the default backend section, that explicitly say that they handle any host for that port, for the frontend binding to port 7777?

And only in case there is no such “catch all” rule defined, fallback to include all services not already having a specific routing rule defined for the source port in question.

Ah, so it is route to all by default, with a weird kind of opt-out, rather than a opt-in for being a default route. I fail to see where this, current, behavior is useful, at least when there are more than one source port.

Ok, I may not be a fan of the workaround, but it works, and as I am deploying my services automatically, it was just two lines to fix it, no need to add ugly config for every service as I first imagined.

        for service, ports in services:
            # workaround to avoid all services ending up in all default backends for all source ports
            if ports:
                ports.append ('opt-out.default=666')

            self.proxy_service (proxy, service, ports)