mirror of
https://github.com/status-im/consul.git
synced 2025-01-24 12:40:17 +00:00
Fix subtle loop bug and add test
This commit is contained in:
parent
07f81991df
commit
70bc89b7f4
@ -270,8 +270,11 @@ func findIngressServiceMatchingUpstream(l structs.IngressListener, u structs.Ups
|
|||||||
return &s
|
return &s
|
||||||
}
|
}
|
||||||
if s.Name == structs.WildcardSpecifier &&
|
if s.Name == structs.WildcardSpecifier &&
|
||||||
s.NamespaceOrDefault() == wantSID.NamespaceOrDefault() {
|
s.NamespaceOrDefault() == wantSID.NamespaceOrDefault() &&
|
||||||
foundSameNSWildcard = &s
|
s.PartitionOrDefault() == wantSID.PartitionOrDefault() {
|
||||||
|
// Make a copy so we don't take a reference to the loop variable
|
||||||
|
found := s
|
||||||
|
foundSameNSWildcard = &found
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Didn't find an exact match. Return the wildcard from same service if we
|
// Didn't find an exact match. Return the wildcard from same service if we
|
||||||
|
Loading…
x
Reference in New Issue
Block a user