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

check that node.roles is defined #700

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mindejulian
Copy link

@mindejulian mindejulian commented Jan 19, 2024

Description

When using the Mock from "@elastic/elasticsearch-mock" the roles on the node are not defined, this pr checks that roles are defined before checking if the node is a cluster_manager or master only node.

Issues Resolved

Closes #640

Check List

  • New functionality includes testing.
    • All tests pass
  • Linter check was successfull - yarn run lint doesn't show any errors
  • Commits are signed per the DCO using --signoff
  • Changelog was updated.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@dblock
Copy link
Member

dblock commented Jan 19, 2024

Please add a test and CHANGELOG entry. Thanks!

@mindejulian
Copy link
Author

Tried to add tests, but found a nice workaround instead.
const mockClient = new Client({ node: 'http://localhost:9200', nodeFilter: () => { return true }, Connection: mock.getConnection() as unknown as typeof Connection, })

@dblock
Copy link
Member

dblock commented Jan 19, 2024

This is still a bug, care to finish a fix? I'll reopen.

@dblock dblock reopened this Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] undefined cluster_manager when running local mock
2 participants