Closed mihaitodor closed 5 years ago
@relistan Regarding the "Change the state in StateChangedEvent to be a pointer type" change, I did some testing in our dev environment with the following setup on a test host:
LISTENERS_URLS="http://localhost:7778/update,http://localhost:7779/update"
and --cluster-ip="a_valid_sidecar_seed"
At this point, both haproxy-api containers have the expected config written in /etc/haproxy.cfg
.
As a first experiment, I bounced a service and noticed that both haproxy-api containers have received the update and started proxying the new service instance.
Then, as a second experiment, I also took down Sidecar on one of the existing nodes in the cluster and observed updates coming into both haproxy-api containers, which seemed consistent.
I didn't observe any crashes or unexpected messages, so I believe 870816f is safe. Please let me know if you wish me to do any other experiments.
Hey @relistan, this is a big-ish PR with quite a few cleanup changes that I'd like to get merged before I proceed with implementing #44. It was a good way for me to re-explore the code a bit and see what's in here. I'm happy to do adjust these changes in any way or not do them at all, but the main goal was to remove all warnings reported by golangci-lint and enable it for Travis builds.
Changes to review individually:
StateChangedEvent
to be a pointer type - It looks like this should have been a pointer from the beginning to avoid warnings about potentially copying locks around. I don't think I'm breaking anything by changing this struct.haproxy-api
doesn't seem to use it.--cluster-ip
flag optional and check Kingpin parse errors - We weren't checking the error when parsing the Kingpin flags, so this flag was never mandatory. Looking at its usage, I don't think it should be, given that it stomps over whatever is set in theSIDECAR_SEEDS
environment variable. I adjusted the Readme to explain this.golangci-lint
needs at least go 1.10, so I thought it's best to just upgrade to the latest version. I can fall back to go 1.10 if you prefer that.