Skip to content

Commit

Permalink
Fix unbold header Device Group Attributes and remove unused var in …
Browse files Browse the repository at this point in the history
…func `nodeCSIVolumeNames` (#16138)

* Fix  unbold header and remove unused var in  func
Signed-off-by: dttung2905 <[email protected]>

* Add CHANGELOG file
Signed-off-by: dttung2905 <[email protected]>

* Apply suggestions from review <Charlie Voiselle>

---------

Signed-off-by: dttung2905 <[email protected]>
Co-authored-by: Charlie Voiselle <[email protected]>
Co-authored-by: Tim Gross <[email protected]>
  • Loading branch information
3 people authored Feb 13, 2023
1 parent b8616bf commit 6d27cee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .changelog/16138.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
cli: Fix unbolded header `Device Group Attributes`
```
8 changes: 4 additions & 4 deletions command/node_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func nodeCSINodeNames(n *api.Node) []string {
return names
}

func nodeCSIVolumeNames(n *api.Node, allocs []*api.Allocation) []string {
func nodeCSIVolumeNames(allocs []*api.Allocation) []string {
var names []string
for _, alloc := range allocs {
tg := alloc.GetTaskGroup()
Expand Down Expand Up @@ -489,7 +489,7 @@ func (c *NodeStatusCommand) formatNode(client *api.Client, node *api.Node) int {
if c.short {
basic = append(basic, fmt.Sprintf("Host Volumes|%s", strings.Join(nodeVolumeNames(node), ",")))
basic = append(basic, fmt.Sprintf("Host Networks|%s", strings.Join(nodeNetworkNames(node), ",")))
basic = append(basic, fmt.Sprintf("CSI Volumes|%s", strings.Join(nodeCSIVolumeNames(node, runningAllocs), ",")))
basic = append(basic, fmt.Sprintf("CSI Volumes|%s", strings.Join(nodeCSIVolumeNames(runningAllocs), ",")))
basic = append(basic, fmt.Sprintf("Drivers|%s", strings.Join(nodeDrivers(node), ",")))
c.Ui.Output(c.Colorize().Color(formatKV(basic)))

Expand Down Expand Up @@ -518,7 +518,7 @@ func (c *NodeStatusCommand) formatNode(client *api.Client, node *api.Node) int {
if !c.verbose {
basic = append(basic, fmt.Sprintf("Host Volumes|%s", strings.Join(nodeVolumeNames(node), ",")))
basic = append(basic, fmt.Sprintf("Host Networks|%s", strings.Join(nodeNetworkNames(node), ",")))
basic = append(basic, fmt.Sprintf("CSI Volumes|%s", strings.Join(nodeCSIVolumeNames(node, runningAllocs), ",")))
basic = append(basic, fmt.Sprintf("CSI Volumes|%s", strings.Join(nodeCSIVolumeNames(runningAllocs), ",")))
driverStatus := fmt.Sprintf("Driver Status| %s", c.outputTruncatedNodeDriverInfo(node))
basic = append(basic, driverStatus)
}
Expand Down Expand Up @@ -821,7 +821,7 @@ func (c *NodeStatusCommand) formatDeviceAttributes(node *api.Node) {
}

if first {
c.Ui.Output("\nDevice Group Attributes")
c.Ui.Output("\n[bold]Device Group Attributes[reset]")
first = false
} else {
c.Ui.Output("")
Expand Down

0 comments on commit 6d27cee

Please sign in to comment.