Repository navigation
Label names displayed as-Is when nodes lack the specified labels - #352
Merged
Merged
Conversation
rnakamine
commented
Dec 9, 2024
| labelValue = n.ComputeLabel(label) | ||
| if labelValue == label { | ||
| labelValue = "-" | ||
| } |
Contributor
Author
There was a problem hiding this comment.
The ComputeLabel method returns the input label name as-is if it doesn't match a custom label; in such cases, it should display - instead.
eks-node-viewer/pkg/model/node.go
Lines 294 to 305 in 3ce0e6f
Contributor
There was a problem hiding this comment.
You can just put this into the ComputeLabel function (e.g. return - instead of labelName)
Contributor
Author
There was a problem hiding this comment.
You can just put this into the ComputeLabel function (e.g. return - instead of labelName)
Fixed in 507e7c8
Contributor
Author
|
Hi @tzneal , could you please look at this PR when you can? Thanks! |
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.
Issue #, if available:
Description of changes:
When specifying custom labels with the -extra-labels option, if a node does not have the specified label, the label name is displayed as-is.
For example, if you specify a label such as type using the following command:
$ eks-node-viewer -extra-labels type,eks-node-viewer/node-age -node-sort typeThe output may look like this:
To address this, I modified the behavior so that if labels other than
eks-node-viewer/node-ageoreks-node-viewer/node-xxx-usageare specified, and a node does not have the specified label, a-will be displayed instead.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.