plugin/etcd: Stop target stripping at the end of a name (#8584)

Stops stripping when the next-label operation reaches the end sentinel in DNS

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang
2026-09-29 20:11:44 -07:00
committed by GitHub
parent 23ba070a81
commit 6ad382b53d
2 changed files with 24 additions and 1 deletions

View File

@@ -165,6 +165,9 @@ func targetStrip(name string, targetStrip int) string {
offset, end := 0, false
for range targetStrip {
offset, end = dns.NextLabel(name, offset)
if end {
break
}
}
if end {
// We overshot the name, use the original one.