feat: support custom node role label sources - #615
Merged
Merged
Conversation
Node roles only read the two built-in Kubernetes label sources, so custom role labels could not appear in the same column. Add configured prefixes and exact keys with normal overrides and reload support, and use the resolved roles for display, filtering, and sorting. Closes #614
Greptile SummaryThis PR adds configurable label prefixes and exact label keys for deriving the built-in node
Confidence Score: 5/5The PR appears safe to merge; no actionable correctness, security, or repository-rule issues were identified. The configured sources are compiled and refreshed across each supported lifecycle path, and all node-role consumers share the same extracted value without altering custom path-backed columns. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
C["Base, cluster, and context config"] --> M["Resolve overrides"]
M --> P["Compile node-role sources"]
P --> A["App.node_roles"]
A --> V["Attach sources to node ViewSpec"]
V --> E["Extract built-in and custom roles"]
E --> N["Sort and deduplicate"]
N --> D["Display"]
N --> F["Filter"]
N --> S["Sort"]
Reviews (1): Last reviewed commit: "feat: support custom node role label sou..." | Re-trigger Greptile |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Nodes with custom role labels showed
<none>in ROLES. Add[node_roles].label_prefixesandlabel_keysso the built-in column can collect roles from custom key suffixes and label values. Both Kubernetes sources remain active; roles are sorted and duplicates are removed.The settings support startup, cluster/context overrides, and reload. Display, filtering, and sorting use the same values. Empty prefixes produce a warning and are skipped. Custom path columns retain their own values.
Agreed discussion: #577 (comment)
Closes #614
Validation:
just check(format check, clippy with warnings denied, and all tests). Added keyboard-driven tests for defaults, custom sources, empty values and prefixes, duplicate roles, filtering, sorting, overrides, reload, and custom views.