- Closes: #1482
- Closes: #1280
This also corrects poor handling of whitespace around the "file" function
throughout the templates, given experiences with the network templates while
implementing the bond behavior. Since the file function actually does produce
output (that is parsed by Warewulf itself) it should not collaps prefix
whitespace.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Previous name (before #1641) was "container." New name (from #1641) was "image"
but a plural name seems better.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
`wwctl node edit` appears to not be working properly since MergeNode. This
refactor, partly towards #918, resolves the issues with `node edit` and updates
`profile edit` to match.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
- Updated `wwctl upgrade` to handle updates
- Maintained `.Container` and `.ContainerName` in tstruct
- Added `ContainerName()` methods to node and profile objects
- Added `--container`, `-C` aliases to wwctl commands (`<node|profile> <add|set>`)
- Added `wwctl container` alias
- Added support for `container_exit.sh` if `image_exit.sh` is not found
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
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>
Because net.IP is derived from []byte, it was being handled by mergo as a
slice. This adds an additional transformer that handles net.IP specifically,
and also watches for this type in field tracking.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
- Make Resources an `interface{}` to support arbitrary yaml
- Remove `wwctl resource` as incompatible with arbitrary yaml
- Revert changes to host overlay templates
- Remove NFS mount options from warewulf.conf
- Replace NFS support / resource prefix with "fstab" resource
- Move resources to profiles
- Migrate warewulf.conf mounts to nodes.conf with `wwctl upgrade`
- Add documentation
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
- Benchmarks overlay build in an environment with 1000 nodes
- Updates testenv to support both benchmarks and tests
To execute:
```
go test github.com/warewulf/warewulf/internal/app/wwctl/overlay/build -bench Benchmark_Overlay_Build
```
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Rendering overlay templates requires fetching and populating / merging all
other nodes, because overlay templates have access to all cluster node info.
This was previously being done for each template render, but is not being done
once for each render operation and re-used for each template render.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Previously, cpio output would only be shown as a debug message. Now it is shown
as an error message if cpio returns an error.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
- No receiver of the error is checking its type
- No receiver of the error is checking its `Name` attribute
- Any receiver of the error knows the name already
Signed-off-by: Jonathon Anderson <janderson@ciq.com>