Expand nodes when rendering overlay templates
Before #1628, all default constructors for nodes and profiles attempted to construct objects with pre-populated empty fields (e.g., for pointers to member structs and for collections that default to nil). Changes to MergeNode in #1629 changed this behavior intentionally to simplify the generation of minimal json; but this had the unintended side-effect of breaking existing templates that may now encounter a nil pointer, particularly when accessing member structs. Introduced here, the Expand() methods on Node and Profile are now responsible for populating such fields, and Node.Expand() is now called during template processing. Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -259,6 +259,16 @@ data from other structures.
|
||||
- Version:
|
||||
- Args: quiet crashkernel=no vga=791 net.naming-scheme=v238
|
||||
|
||||
- Ipmi:
|
||||
- Ipaddr: <nil>
|
||||
- Netmask: <nil>
|
||||
- Port:
|
||||
- Gateway: <nil>
|
||||
- UserName:
|
||||
- Password:
|
||||
- Interface:
|
||||
- Write:
|
||||
- Tags:
|
||||
- NetDevs[default]:
|
||||
- Type:
|
||||
- OnBoot: true
|
||||
|
||||
Reference in New Issue
Block a user