use list of resources in profiles/nodes

access the resource not at node or profile level but
in the templates as global variable

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2024-11-26 10:58:23 +01:00
committed by Jonathon Anderson
parent 5ff27061a3
commit 07c77a63d5
9 changed files with 34 additions and 17 deletions

View File

@@ -22,6 +22,8 @@ nodes:
network devices:
net0:
device: eth0
resource_list:
- NFSHOME
test_node2:
primary network: net1
network devices:
@@ -51,7 +53,10 @@ nodes:
network devices:
override:
device: ib1
`
resource:
NFSHOME:
mountpoint: /home
`
var ret NodesYaml
err := yaml.Unmarshal([]byte(data), &ret)
assert.NoError(t, err)
@@ -117,6 +122,12 @@ func Test_Primary_Network(t *testing.T) {
assert.Equal(t, "ib1", test_node6.NetDevs["override"].Device)
assert.Equal(t, "profile", test_node6.NetDevs["override"].Type)
})
t.Run("resource is defined", func(t *testing.T) {
assert.Contains(t, test_node1.ResourceList, "NFSHOME")
res, err := c.GetResource(test_node1.ResourceList[0])
assert.NoError(t, err)
assert.Contains(t, res, "mountpoint")
})
}
var findDiscoverableNodeTests = []struct {