Refactor GetNode merging with new MergeNode method

- Adds many tests for node+profile merging
- Ensures that tracked fields match mergo results

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2024-12-12 10:52:11 -07:00
parent baf8124186
commit 1a3d037703
11 changed files with 1223 additions and 241 deletions

View File

@@ -156,8 +156,8 @@ nodes:
stdout: `
NODE FIELD PROFILE VALUE
---- ----- ------- -----
n01 Comment default profilecomment
n01 Profiles -- default
n01 Comment default profilecomment
`,
inDb: `nodeprofiles:
default:
@@ -175,8 +175,8 @@ nodes:
stdout: `
NODE FIELD PROFILE VALUE
---- ----- ------- -----
n01 Comment SUPERSEDED nodecomment
n01 Profiles -- default
n01 Comment SUPERSEDED nodecomment
`,
inDb: `nodeprofiles:
default:
@@ -293,7 +293,7 @@ nodes:
stdout: `
NODE NAME KERNEL VERSION CONTAINER OVERLAYS (S/R)
--------- -------------- --------- --------------
n01 -- -- sop1/nop1,~rop1,rop1,rop2
n01 -- -- sop1/rop1,rop2,nop1,~rop1
`,
inDb: `nodeprofiles:
p1:
@@ -319,7 +319,7 @@ nodes:
NODE FIELD PROFILE VALUE
---- ----- ------- -----
n01 Profiles -- p1
n01 RuntimeOverlay p1+ nop1,~rop1,rop1,rop2
n01 RuntimeOverlay p1,n01 rop1,rop2,nop1,~rop1
n01 SystemOverlay p1 sop1
`,
inDb: `nodeprofiles:
@@ -346,7 +346,7 @@ nodes:
NODE FIELD PROFILE VALUE
---- ----- ------- -----
n01 Profiles -- p1
n01 RuntimeOverlay p1+ nop1,rop1,rop2
n01 RuntimeOverlay p1,n01 rop1,rop2,nop1
`,
inDb: `nodeprofiles:
p1: