Skip to content

Alertmanager: Deprecate (but keep compatibility) of cluster flags #3677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

gotjosh
Copy link
Contributor

@gotjosh gotjosh commented Jan 11, 2021

What this PR does:

Deprecates flags with the cluster prefix within the Alertmanager. I've
opted for a "high-availability" nomenclature which feel a bit more
aligned with what the flags are actually doing.

Signed-off-by: gotjosh josue@grafana.com

Which issue(s) this PR fixes:
Fixes #3670

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@gotjosh gotjosh force-pushed the alertmanager-cluster-flags-prefix branch 2 times, most recently from b172430 to e0ac521 Compare January 13, 2021 03:27
@gotjosh
Copy link
Contributor Author

gotjosh commented Jan 13, 2021

I spent some time trying to debug the integration test w/o much luck. It seems like the DNS resolver for docker is not working as expected on CI as the past pass locally. My understanding is that Docker uses the host's /etc/resolv.conf but I'm not able to inspect that file by logging on the machine directly - any help?

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did great! LGTM with a couple of nits.

I'm now going to look into the integration test issue.

@pracucci
Copy link
Contributor

I'm now going to look into the integration test issue.

To keep compatibility across platforms, a container needs to be address by the host <network name>-<container name>, which is what the e2e framework does when you use functions like NetworkEndpoint(). However, such functions can't be used in this specific integration test because you have chicken-egg problem: to call NetworkEndpoint() you need the service first, but you need to create the first you need you need the peers list first.

I've refactored the code and fixed it (see commit).

@gotjosh gotjosh force-pushed the alertmanager-cluster-flags-prefix branch from 7076474 to 7ab057c Compare January 18, 2021 20:43
gotjosh and others added 4 commits January 18, 2021 16:47
Deprecates flags with the cluster prefix within the Alertmanager. I've
opted for a "high-availability" nomenclature which feel a bit more
aligned with what the flags are actually doing.

Signed-off-by: gotjosh <josue@grafana.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Co-authored-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: gotjosh <josue@grafana.com>
Signed-off-by: gotjosh <josue@grafana.com>
@gotjosh gotjosh force-pushed the alertmanager-cluster-flags-prefix branch from 7ab057c to e62f069 Compare January 18, 2021 20:48
@gotjosh
Copy link
Contributor Author

gotjosh commented Jan 18, 2021

which is what the e2e framework does when you use functions like NetworkEndpoint()

Thanks @pracucci, I initially suspected it had something to do with that but when I inspected the return value of NetworkEndpoint() locally in the debugger it did not have the network name as a prefix so I quickly discarded it. 🤦

@gotjosh gotjosh requested a review from pracucci January 18, 2021 20:54
Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Is it worth mentioning that old flags still take precedence, if set to non-default values?

@pracucci pracucci merged commit 55aacb9 into cortexproject:master Jan 19, 2021
simonswine pushed a commit to grafana/e2e that referenced this pull request Jan 13, 2022
…rtexproject/cortex#3677)

* Alertmanager: Deprecate (but keep compatibility) of cluster flags

Deprecates flags with the cluster prefix within the Alertmanager. I've
opted for a "high-availability" nomenclature which feel a bit more
aligned with what the flags are actually doing.

Signed-off-by: gotjosh <josue@grafana.com>

* Fixed integration test

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Apply suggestions from code review

Co-authored-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: gotjosh <josue@grafana.com>

* Address review comments

Signed-off-by: gotjosh <josue@grafana.com>

Co-authored-by: Marco Pracucci <marco@pracucci.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alertmanager cluster CLI flags have the wrong prefix
4 participants