Skip to content

Commit

Permalink
Fix display of profiles in node list
Browse files Browse the repository at this point in the history
- Closes warewulf#1496

Signed-off-by: Jonathon Anderson <[email protected]>
  • Loading branch information
anderbubble authored and mslacken committed Nov 25, 2024
1 parent 6f93d68 commit e098455
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
when warewulf secure option in warewulf.conf is enabled. #806
- Allow iPXE to continue booting without runtime overlay. #806
- Format errors in logs as strings. #1563
- Fix display of profiles during node list. #1496

## v4.5.8, 2024-10-01

Expand Down
44 changes: 22 additions & 22 deletions internal/app/wwctl/node/list/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ func Test_List(t *testing.T) {
args: []string{},
wantErr: false,
stdout: `
NODE NAME PROFILES NETWORK
--------- -------- -------
n01 [default] --
NODE NAME PROFILES NETWORK
--------- -------- -------
n01 default --
`,
inDb: `nodeprofiles:
default: {}
Expand All @@ -45,10 +45,10 @@ nodes:
args: []string{},
wantErr: false,
stdout: `
NODE NAME PROFILES NETWORK
--------- -------- -------
n01 [default] --
n02 [default] --
NODE NAME PROFILES NETWORK
--------- -------- -------
n01 default --
n02 default --
`,
inDb: `nodeprofiles:
default: {}
Expand All @@ -66,10 +66,10 @@ nodes:
args: []string{"n01,n02"},
wantErr: false,
stdout: `
NODE NAME PROFILES NETWORK
--------- -------- -------
n01 [default] --
n02 [default] --
NODE NAME PROFILES NETWORK
--------- -------- -------
n01 default --
n02 default --
`,
inDb: `nodeprofiles:
default: {}
Expand All @@ -87,10 +87,10 @@ nodes:
args: []string{"n01,n03"},
wantErr: false,
stdout: `
NODE NAME PROFILES NETWORK
--------- -------- -------
n01 [default] --
n03 [default] --
NODE NAME PROFILES NETWORK
--------- -------- -------
n01 default --
n03 default --
`,
inDb: `nodeprofiles:
default: {}
Expand All @@ -117,9 +117,9 @@ nodes:
args: []string{"n01,"},
wantErr: false,
stdout: `
NODE NAME PROFILES NETWORK
--------- -------- -------
n01 [default] --
NODE NAME PROFILES NETWORK
--------- -------- -------
n01 default --
`,
inDb: `nodeprofiles:
default: {}
Expand All @@ -137,9 +137,9 @@ nodes:
args: []string{},
wantErr: false,
stdout: `
NODE NAME PROFILES NETWORK
--------- -------- -------
n01 [default] default
NODE NAME PROFILES NETWORK
--------- -------- -------
n01 default default
`,
inDb: `nodeprofiles:
default:
Expand Down Expand Up @@ -238,7 +238,7 @@ nodes:
stdout: `
NODE NAME PROFILES NETWORK
--------- -------- -------
n01 [p1 p2] --
n01 p1,p2 --
`,
inDb: `nodeprofiles:
p1: {}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/api/node/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func NodeList(nodeGet *wwapiv1.GetNodeList) (nodeList wwapiv1.NodeList, err erro
}
sort.Strings(netNames)
nodeList.Output = append(nodeList.Output,
fmt.Sprintf("%s:=:%s:=:%s", n.Id(), n.Profiles, strings.Join(netNames, ", ")))
fmt.Sprintf("%s:=:%s:=:%s", n.Id(), strings.Join(n.Profiles, ","), strings.Join(netNames, ", ")))
}
} else if nodeGet.Type == wwapiv1.GetNodeList_Network {
nodeList.Output = append(nodeList.Output,
Expand Down

0 comments on commit e098455

Please sign in to comment.