Commit Graph

974 Commits

Author SHA1 Message Date
Xu YANG
5f7713cd4c Merge branch 'main' into image-size 2025-02-07 12:00:50 +09:00
Xu YANG
dd5f083022 Merge branch 'main' into dracut-asset-tag-urlencode 2025-02-07 11:55:03 +09:00
Jonathon Anderson
6bfcfc5fda Prevent merging of zero-value net.IP fields
- Fixes: #1710

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-06 16:43:21 -07:00
Jonathon Anderson
8bf35c7657 Only calculate image chroot size when requested
- Fixes: #1504

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-05 20:51:41 -07:00
Jonathon Anderson
6a250f3f96 Set execute permissions for intermediate directories
- Fixes: #1655

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-05 20:04:22 -07:00
Jonathon Anderson
38791c74ad Create site overlay directory
-Fixes: #1690

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-04 09:03:08 +01:00
Jonathon Anderson
5bc82f97cc Urlencode asset keys during dracut boot
- Fixes: #1610

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-03 13:49:29 -07:00
Jonathon Anderson
6ad7178ad8 Fix a panic in warewulfd when no kernel fields are specified
- Fixes: #1689

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-03 03:48:10 -07:00
Jonathon Anderson
1f607b679b wwctl node list <--yaml|--json> outputs a map keyed by node name
- Fixes: #1667

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-03 12:32:50 +01:00
Jonathon Anderson
e3d90cd323 Prefer parent profile values over child profile values.
- Fixes: #1672

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-03 12:16:12 +01:00
Jonathon Anderson
032db29f87 Don't populate NetDevs[].Type or NetDevs[].Netmask during upgrade
- 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>
2025-02-03 11:00:12 +01:00
Jonathon Anderson
4f83885c5b Show each overlay only once #1675
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-01 13:40:12 +01:00
Jonathon Anderson
f931eb6a0a Fixed negation for slice field elements during profile/node merge
- Fixes: #1677

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-01 13:32:10 +01:00
Elmar Pruesse
9ebdb8612b Use sh to parse and exec IPMI command
- Fixes: #1663

Signed-off-by: Elmar Pruesse <pruessee@njhealth.org>
2025-01-30 02:14:42 -07:00
Jonathon Anderson
fce3bc8aff Release v4.6.0rc1
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-29 04:03:29 -07:00
Christian Goll
755411d3cb Added warewulfd:/overlay-file/{overlay}/{path...}?render={nodeID}
Co-authored-by: Jonathon Anderson <janderson@ciq.com>
Signed-off-by: Christian Goll <cgoll@suse.com>
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-29 00:08:30 -07:00
Jonathon Anderson
51f61f93c4 Refactor kernel args as a slice
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-21 09:52:58 -07:00
Jonathon Anderson
c209dadc1f Update network interface bonding configuration and documentation
- 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>
2025-01-21 09:42:27 -07:00
Jonathon Anderson
32081d0917 Document template functions
- Closes: #698

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-21 09:42:27 -07:00
Xu YANG
ba9fb3c273 Merge pull request #1649 from anderbubble/images-directory
Change image provision directory to "images"
2025-01-28 09:27:29 +09:00
Jonathon Anderson
ca61494297 Change image provision directory to "images"
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>
2025-01-19 14:42:45 -07:00
Jonathon Anderson
73a8ef8e0e Refactor wwctl <node|profile> edit and fix bugs
`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>
2025-01-19 13:02:18 -07:00
Jonathon Anderson
a8fab3e844 Enhancements for node.Field formatting
- Complex values are now marshalled as json
- Booleans are now represented as truth values

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-19 12:55:19 -07:00
Jonathon Anderson
d6d1e37c83 Merge pull request #1641 from anderbubble/rename-container-node-image
Rename "container" to "image"
2025-01-23 21:45:41 -07:00
Xu YANG
55c2f155b3 Merge pull request #1644 from anderbubble/vscode-recommendations
Linting fixes called-out by vscode
2025-01-24 08:55:47 +09:00
Xu YANG
0400a21e85 Merge pull request #1645 from anderbubble/remove-upgrade-printf
Remove a vestigial printf from wwctl upgrade
2025-01-24 08:53:28 +09:00
Jonathon Anderson
2e057d3a81 Remove a vestigial printf from wwctl upgrade
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-19 07:24:45 -07:00
Jonathon Anderson
45a690ca4e Rename "container" to "image"
- 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>
2025-01-19 05:54:19 -07:00
Jonathon Anderson
4be3e6db9f Linting fixes called-out by vscode
A few linting issues that were called out by vscode.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-19 05:26:43 -07:00
Jonathon Anderson
57d28c5bc9 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>
2025-01-19 04:26:01 -07:00
Jonathon Anderson
22657fed36 Fix a null-pointer bug in wwctl upgrade config
Also removing some vestigial development-debug output.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-19 00:35:34 -07:00
Jonathon Anderson
c06f558cf4 fixup! Use Node literal in MergeNode, not EmptyNode()
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-18 10:12:08 -07:00
Jonathon Anderson
b50fb3f3ef Fix handling of net.IP during node merge
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>
2025-01-18 10:07:19 -07:00
Jonathon Anderson
dae8d004b3 Use Node literal in MergeNode, not EmptyNode()
EmptyNode populates empty sub-structs, which interferes with omitempty during
serialization.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-18 09:48:26 -07:00
Jonathon Anderson
f0e634183e Consolidate MergeNode merge behavior to an inner merge function
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-18 09:47:45 -07:00
Jonathon Anderson
e478adc45d Add InterfaceTransformer{} to a Merge call that omitted it
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-18 07:33:11 -07:00
Jonathon Anderson
bc52f3b7d7 Recommended changes from review of #1568
- 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>
2025-01-17 10:33:37 -07:00
Jonathon Anderson
eff1edd038 Fixing tests in review of #1568
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-17 01:27:15 -07:00
Christian Goll
847d11611b creating exports from resource
Signed-off-by: Christian Goll <cgoll@suse.com>
2025-01-16 23:00:37 -07:00
Christian Goll
07c77a63d5 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>
2025-01-16 23:00:37 -07:00
Christian Goll
5ff27061a3 added remote resources
Signed-off-by: Christian Goll <cgoll@suse.com>
2025-01-16 23:00:37 -07:00
Christian Goll
455d9b65e4 Fix panic ObjectIsEmpty for bool
Signed-off-by: Christian Goll <cgoll@suse.com>
2025-01-15 13:34:45 +01:00
Jonathon Anderson
7e742b0d8a Fix DelProfile to operate on profiles, not nodes.
- Fixes: #1622

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-27 05:58:46 -07:00
Jonathon Anderson
749f1eba1d Fix a panic introduced by #1598
- Fixes: #1618

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-25 13:46:04 -07:00
Jonathon Anderson
a18913924d Benchmarking for wwctl overlay build
- 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>
2024-12-25 12:34:23 -07:00
Jonathon Anderson
83af6021c0 Recast Profiles as a Profile field and support recursion
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-25 09:10:05 -07:00
Jonathon Anderson
deaf9c99d7 Remove DEBUG logging in test suite
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-25 09:10:02 -07:00
Jonathon Anderson
1a3d037703 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>
2024-12-25 09:07:28 -07:00
Jonathon Anderson
c244adc7f6 Performance improvements for overlay build
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>
2024-12-25 08:48:14 -07:00
Jonathon Anderson
a59403ab3b Parallel overlay builds
- Closes #1018

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-25 08:48:14 -07:00