Skip to content

Fix a bug that wrongly trims domains when there is an overlap with DC name 1.14.x#18162

Merged
dhiaayachi merged 1 commit intorelease/1.14.xfrom
trim_domains_1.14.x
Jul 18, 2023
Merged

Fix a bug that wrongly trims domains when there is an overlap with DC name 1.14.x#18162
dhiaayachi merged 1 commit intorelease/1.14.xfrom
trim_domains_1.14.x

Conversation

@dhiaayachi
Copy link
Contributor

Description

This a backport of #17160

… 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: Dhia Ayachi <dhia@hashicorp.com>
@dhiaayachi dhiaayachi added pr/no-changelog PR does not need a corresponding .changelog entry pr/no-backport labels Jul 17, 2023
@dhiaayachi dhiaayachi merged commit cae7bf9 into release/1.14.x Jul 18, 2023
@dhiaayachi dhiaayachi deleted the trim_domains_1.14.x branch July 18, 2023 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr/no-backport pr/no-changelog PR does not need a corresponding .changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants