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
[Stack Monitoring] Convert node roles into array #167628
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tonyghiani
added
release_note:fix
Team:Infra Monitoring UI - DEPRECATED
DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
backport:prev-minor
Backport to the previous minor version (i.e. one version back from main)
labels
Sep 29, 2023
Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
miltonhultgren
approved these changes
Sep 29, 2023
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Oct 4, 2023
## 📓 Summary When the `elasticsearch.node.roles` property is set to a single role, the API returns a single string instead of a list, failing when computing the role list client side and resulting in an empty list. This fix is to parse the node roles into a list if the API returns a single role string and correctly displays the roles. E.g. Assuming we have the following roles configuration ``` [ { "_source": { "elasticsearch": { "node": { "roles": [ "data", "master" ] } } } }, { "_source": { "elasticsearch": { "node": { "roles": "master" } } } } ] ``` It would fail at parsing the second node roles and fall back into the "coordinating only" default. <img width="814" alt="Screenshot 2023-09-29 at 13 05 14" src="https://github.com/elastic/kibana/assets/34506779/bf49a974-650a-44cc-827b-b3dc834d6cee"> Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co> (cherry picked from commit a69957e)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Oct 4, 2023
…67966) # Backport This will backport the following commits from `main` to `8.10`: - [[Stack Monitoring] Convert node roles into array (#167628)](#167628) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Marco Antonio Ghiani","email":"marcoantonio.ghiani01@gmail.com"},"sourceCommit":{"committedDate":"2023-10-04T08:50:07Z","message":"[Stack Monitoring] Convert node roles into array (#167628)\n\n## 📓 Summary\r\n\r\nWhen the `elasticsearch.node.roles` property is set to a single role,\r\nthe API returns a single string instead of a list, failing when\r\ncomputing the role list client side and resulting in an empty list.\r\n\r\nThis fix is to parse the node roles into a list if the API returns a\r\nsingle role string and correctly displays the roles.\r\n\r\nE.g. Assuming we have the following roles configuration\r\n```\r\n[\r\n {\r\n \"_source\": {\r\n \"elasticsearch\": {\r\n \"node\": {\r\n \"roles\": [\r\n \"data\",\r\n \"master\"\r\n ]\r\n }\r\n }\r\n }\r\n },\r\n {\r\n \"_source\": {\r\n \"elasticsearch\": {\r\n \"node\": {\r\n \"roles\": \"master\"\r\n }\r\n }\r\n }\r\n }\r\n ]\r\n\r\n```\r\n\r\nIt would fail at parsing the second node roles and fall back into the\r\n\"coordinating only\" default.\r\n\r\n<img width=\"814\" alt=\"Screenshot 2023-09-29 at 13 05 14\"\r\nsrc=\"https://github.com/elastic/kibana/assets/34506779/bf49a974-650a-44cc-827b-b3dc834d6cee\">\r\n\r\nCo-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>","sha":"a69957e0fc821b9644a70df2a57ccb672fd71001","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Infra Monitoring UI","backport:prev-minor","v8.11.0"],"number":167628,"url":"#167628 Monitoring] Convert node roles into array (#167628)\n\n## 📓 Summary\r\n\r\nWhen the `elasticsearch.node.roles` property is set to a single role,\r\nthe API returns a single string instead of a list, failing when\r\ncomputing the role list client side and resulting in an empty list.\r\n\r\nThis fix is to parse the node roles into a list if the API returns a\r\nsingle role string and correctly displays the roles.\r\n\r\nE.g. Assuming we have the following roles configuration\r\n```\r\n[\r\n {\r\n \"_source\": {\r\n \"elasticsearch\": {\r\n \"node\": {\r\n \"roles\": [\r\n \"data\",\r\n \"master\"\r\n ]\r\n }\r\n }\r\n }\r\n },\r\n {\r\n \"_source\": {\r\n \"elasticsearch\": {\r\n \"node\": {\r\n \"roles\": \"master\"\r\n }\r\n }\r\n }\r\n }\r\n ]\r\n\r\n```\r\n\r\nIt would fail at parsing the second node roles and fall back into the\r\n\"coordinating only\" default.\r\n\r\n<img width=\"814\" alt=\"Screenshot 2023-09-29 at 13 05 14\"\r\nsrc=\"https://github.com/elastic/kibana/assets/34506779/bf49a974-650a-44cc-827b-b3dc834d6cee\">\r\n\r\nCo-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>","sha":"a69957e0fc821b9644a70df2a57ccb672fd71001"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"#167628 Monitoring] Convert node roles into array (#167628)\n\n## 📓 Summary\r\n\r\nWhen the `elasticsearch.node.roles` property is set to a single role,\r\nthe API returns a single string instead of a list, failing when\r\ncomputing the role list client side and resulting in an empty list.\r\n\r\nThis fix is to parse the node roles into a list if the API returns a\r\nsingle role string and correctly displays the roles.\r\n\r\nE.g. Assuming we have the following roles configuration\r\n```\r\n[\r\n {\r\n \"_source\": {\r\n \"elasticsearch\": {\r\n \"node\": {\r\n \"roles\": [\r\n \"data\",\r\n \"master\"\r\n ]\r\n }\r\n }\r\n }\r\n },\r\n {\r\n \"_source\": {\r\n \"elasticsearch\": {\r\n \"node\": {\r\n \"roles\": \"master\"\r\n }\r\n }\r\n }\r\n }\r\n ]\r\n\r\n```\r\n\r\nIt would fail at parsing the second node roles and fall back into the\r\n\"coordinating only\" default.\r\n\r\n<img width=\"814\" alt=\"Screenshot 2023-09-29 at 13 05 14\"\r\nsrc=\"https://github.com/elastic/kibana/assets/34506779/bf49a974-650a-44cc-827b-b3dc834d6cee\">\r\n\r\nCo-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>","sha":"a69957e0fc821b9644a70df2a57ccb672fd71001"}}]}] BACKPORT--> Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani01@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport:prev-minor
Backport to the previous minor version (i.e. one version back from main)
release_note:fix
Team:Infra Monitoring UI - DEPRECATED
DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
v8.10.3
v8.11.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📓 Summary
When the
elasticsearch.node.roles
property is set to a single role, the API returns a single string instead of a list, failing when computing the role list client side and resulting in an empty list.This fix is to parse the node roles into a list if the API returns a single role string and correctly displays the roles.
E.g. Assuming we have the following roles configuration
It would fail at parsing the second node roles and fall back into the "coordinating only" default.