Rather than deriving the identity of template variables by string parsing the
name, identify its relationship to the underlying struct using reflection.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Fields now use the value of a `name` tag on a struct to determine the display
name for a given field. This improves output for boolean-pointer fields, which
otherwise have a P suffix and helper methods to retain backwards-compatibility.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
- Control root device using the node/profile root field
- Add support for `/warewulf/wwinit.d` to run scripts during first stage
- Move first-stage ignition support to `/warewulf/wwinit.d/`
- Add `wwctl <node|profile> set --parttype`
- Add overlay template functions `SystemdEscape` and `SystemdEscapePath`
- Support configuring ignition with resources
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
- Closes: #1661
NetDev defaults don't behave quite the same as standard fields, because they
need to be set per-device. Meanwhile, trying to set a value may erroneously
override values that are on the default profile.
Switch this to a warning rather than attempting to take explicit action.
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>
- Remove kernel imports and kmods images
- Repurpose KernelOverride as container path
- Support Kernel.Version as version prefix for kernel selection
- Compare initramfs by version
Signed-off-by: Jonathon Anderson <janderson@ciq.com>