NinesStack / sidecar

Gossip-based service discovery. Docker native, but supports non-container discovery, too.
MIT License
69 stars 7 forks source link

Fix bug in K8s service disco with duped fields #79

Closed relistan closed 10 months ago

relistan commented 10 months ago

This adds a test to show the problem, then fixes the problem. Also cleans up the code a little bit. The origin of the problem was the very famous Go for loop gotcha with pointers to the loop variable. No matter how long you've worked in Go, this mistake sometimes happens. It will be permanently fixed in Go 1.22. Can't wait.