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

filter volumes by type in 'nomad node status' output #8902

Merged
merged 1 commit into from
Sep 16, 2020

Conversation

tgross
Copy link
Member

@tgross tgross commented Sep 16, 2020

Fixes #8901

Volume requests can be either CSI or host volumes, so when displaying the CSI
volume info for nomad node status -verbose we need to filter out the host
volumes.

@tgross tgross marked this pull request as ready for review September 16, 2020 16:57
@tgross tgross requested a review from notnoop September 16, 2020 16:57
@tgross tgross added this to the 0.12.5 milestone Sep 16, 2020
@tgross
Copy link
Member Author

tgross commented Sep 16, 2020

CircleCI is having a moment, but command tests pass:

$ go test ./command/
ok      github.com/hashicorp/nomad/command      57.430s

Copy link
Contributor

@notnoop notnoop left a comment

Choose a reason for hiding this comment

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

Do we need to update nodeCSIVolumeNames in as well

func nodeCSIVolumeNames(n *api.Node, allocs []*api.Allocation) []string {
var names []string
for _, alloc := range allocs {
tg := alloc.GetTaskGroup()
if tg == nil || len(tg.Volumes) == 0 {
continue
}
for _, v := range tg.Volumes {
names = append(names, v.Name)
}
}
sort.Strings(names)
return names
}

Volume requests can be either CSI or host volumes, so when displaying the CSI
volume info for `nomad node status -verbose` we need to filter out the host
volumes.
@tgross
Copy link
Member Author

tgross commented Sep 16, 2020

Do we need to update nodeCSIVolumeNames in as well

Good catch. Fixed in 91c799b. I took a quick pass through the code base grepping for similar constructs and I think we're good everywhere else.

Updated PR passes tests as well:

$ go test ./command/
ok      github.com/hashicorp/nomad/command      59.781s

@tgross tgross merged commit d60071c into master Sep 16, 2020
@tgross tgross deleted the b-node-status-csi branch September 16, 2020 19:00
tgross added a commit that referenced this pull request Sep 16, 2020
Volume requests can be either CSI or host volumes, so when displaying the CSI
volume info for `nomad node status -verbose` we need to filter out the host
volumes.
tgross added a commit that referenced this pull request Sep 16, 2020
notnoop pushed a commit that referenced this pull request Sep 16, 2020
fredrikhgrelland pushed a commit to fredrikhgrelland/nomad that referenced this pull request Sep 28, 2020
Volume requests can be either CSI or host volumes, so when displaying the CSI
volume info for `nomad node status -verbose` we need to filter out the host
volumes.
fredrikhgrelland pushed a commit to fredrikhgrelland/nomad that referenced this pull request Sep 28, 2020
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nomad node status -verbose panics when a running alloc uses a host volume
2 participants