Skip to content
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

ConsulCatalog StrictChecks #10388

Merged

Conversation

djenriquez
Copy link
Contributor

@djenriquez djenriquez commented Jan 25, 2024

What does this PR do?

This PR allows users to define a StrictChecks config for the consulcatalog provider. StrictChecks lets a user define which healthcheck statuses should be allowed when determining which upstreams to include in the upstream targets.

StrictChecks defaults to "passing", "warning" to preserve the existing behavior, allowing this config to be backwards compatible.

Fix #10074

Motivation

Our organization relies on "warning" health statuses to determine upstreams that are "starting up", which is a different state than "critical", but not yet ready for traffic. The existing build sends traffic immediately to "warning" upstreams, which causes 5XX errors for our use case.

With this config, users can choose what health status to allow based on the available statuses that Consul supports as their organization requires.

More

  • Added/updated tests
  • Added/updated documentation

Additional Notes

Question: will I need to add additional logic to properly handle the different configuration input methods or will the configuration handler automatically unmarshal the values into the provider?

…ich health statuses should be included when determining which upstream containers to include in routing
@djenriquez
Copy link
Contributor Author

Reference Issue: #10074

@ldez ldez changed the title Improvement: ConsulCatalog StrictChecks ConsulCatalog StrictChecks Jan 25, 2024
Copy link
Contributor

@jspdown jspdown left a comment

Choose a reason for hiding this comment

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

Thanks a lot for opening this PR 😃

I have some feedback, nothing critical.

will I need to add additional logic to properly handle the different configuration input methods or will the configuration handler automatically unmarshal the values into the provider?

The configuration will be automatically unmarshaled, there's nothing else to add in the code. But for updating the reference part of the documentation you will have to run make generate.

pkg/provider/consulcatalog/config.go Outdated Show resolved Hide resolved
pkg/provider/consulcatalog/config_test.go Show resolved Hide resolved
pkg/provider/consulcatalog/config_test.go Outdated Show resolved Hide resolved
pkg/provider/consulcatalog/consul_catalog.go Outdated Show resolved Hide resolved
pkg/provider/consulcatalog/config_test.go Outdated Show resolved Hide resolved
… status, reorder properties in test for better visibility, remove unnecessary "defaultRule" from test config
@djenriquez
Copy link
Contributor Author

The only thing I'm unsure of is whether the default values are applied when a user does not define strictChecks in their config, I might be missing a mapping somewhere for this new property. This will be critical to backwards compat, any ideas of the best way to test that or verify that it should work?

@mmatur mmatur self-requested a review February 5, 2024 13:58
@djenriquez
Copy link
Contributor Author

Hi all, checking in if there are other items or actions needed? Thanks!

@jspdown
Copy link
Contributor

jspdown commented Feb 13, 2024

@djenriquez No, sorry for the delay. I couldn't allocate time to review your changes recently. I will have a look at it later today.

Copy link
Contributor

@youkoulayley youkoulayley left a comment

Choose a reason for hiding this comment

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

Tested and works perfectly, just a few minor comments

pkg/provider/consulcatalog/consul_catalog.go Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
pkg/provider/consulcatalog/config.go Outdated Show resolved Hide resolved
@djenriquez
Copy link
Contributor Author

Tested and works perfectly, just a few minor comments

Thanks for the review! Feedback applied 👍 .

Copy link
Contributor

@nmengin nmengin left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution 👍

LGTM

Copy link
Member

@mmatur mmatur left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jspdown jspdown left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this PR, LGTM 🚢

@mmatur
Copy link
Member

mmatur commented Feb 27, 2024

@djenriquez could you please rebase your PR.

Our bot is not able to do it because the PR has been created from an GitHub Organisation fork.

@djenriquez
Copy link
Contributor Author

@djenriquez could you please rebase your PR.

Our bot is not able to do it because the PR has been created from an GitHub Organisation fork.

Definitely, sorry for the delay. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/provider/consul kind/enhancement a new or improved feature. priority/P2 need to be fixed in the future size/L
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

7 participants