Commit Graph

1 Commits

Author SHA1 Message Date
Dhia Ayachi 6c6ce14d5d
Fix a bug that wrongly trims domains when there is an overlap with DC 1.16.x (#18164)
Fix a bug that wrongly trims domains when there is an overlap with DC name (#17160)

* Fix a bug that wrongly trims domains when there is an overlap with DC name

Before this change, when DC name and domain/alt-domain overlap, the domain name incorrectly trimmed from the query.

Example:

Given: datacenter = dc-test, alt-domain = test.consul.
Querying for "test-node.node.dc-test.consul" will faile, because the
code was trimming "test.consul" instead of just ".consul"

This change, fixes the issue by adding dot (.) before trimming

* trimDomain: ensure domain trimmed without modyfing original domains

* update changelog

---------

Co-authored-by: Alex Simenduev <shamil.si@gmail.com>
2023-07-18 10:03:41 -04:00