diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f1e80099..d9ba0b450 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/internal/app/wwctl/node/list/main_test.go b/internal/app/wwctl/node/list/main_test.go index b39c385ee..4ff9c86a4 100644 --- a/internal/app/wwctl/node/list/main_test.go +++ b/internal/app/wwctl/node/list/main_test.go @@ -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: {} @@ -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: {} @@ -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: {} @@ -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: {} @@ -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: {} @@ -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: @@ -238,7 +238,7 @@ nodes: stdout: ` NODE NAME PROFILES NETWORK --------- -------- ------- -n01 [p1 p2] -- +n01 p1,p2 -- `, inDb: `nodeprofiles: p1: {} diff --git a/internal/pkg/api/node/list.go b/internal/pkg/api/node/list.go index 3f177fa91..ebff47e46 100644 --- a/internal/pkg/api/node/list.go +++ b/internal/pkg/api/node/list.go @@ -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,