Skip to content

Wait until cluster is ready before adding to MC-query client + move client creation out of middleware #887

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
merged 9 commits into from
Jun 2, 2022

Conversation

foot
Copy link
Collaborator

@foot foot commented May 30, 2022

  • (The main fix): Bring in changes from core Move kube Client creation into the handlers and out of the middleware weave-gitops#2252 that moves client out of middleware, so routes that don't use the MC-querier (like /v1/clusters), will still work even if there is an issue w/ the MC-querier
  • Check for Ready before adding GitopsCluster to the MC-querier:
    • To stop the querier from trying to connect to non-Ready clusters and bringing down the whole system.
    • Make the system a bit easier to reason about, if GitopCluster is not ready we're not querying it.
    • Potentially this will add another (worst case ~29s) before the cluster begins to be queried
  • Refactor tests a bit as we have to pass through clientsFactory everywhere

Fixes #806
Fixes #829
Fixes #828

- To stop the querier from trying to connect to non-Ready clusters and
  bringing down the whole system.
@foot
Copy link
Collaborator Author

foot commented May 30, 2022

Still receive errors with this which is strange:

{"code":2,"message":"error getting clusters: etcdserver: request timed out","details":[]}

Might be something as the CP comes up.

@foot foot added the bug Something isn't working label May 30, 2022
@foot foot marked this pull request as ready for review June 1, 2022 07:04
@foot foot changed the title Wait until cluster is ready before adding to MC-query client Wait until cluster is ready before adding to MC-query client + move client creation out of middleware Jun 1, 2022
Copy link
Contributor

@alichaddad alichaddad 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
Member

@sarataha sarataha left a comment

Choose a reason for hiding this comment

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

Perfect! 🙂 🥇

@foot foot merged commit c98ce56 into main Jun 2, 2022
@foot foot deleted the wait-for-gitopscluster-ready branch June 2, 2022 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants