Commit Graph

1089 Commits

Author SHA1 Message Date
Jonathon Anderson
949dc9d46b Restore idempotency of PUT /api/nodes/{id}
HTTP PUT is supposed to be idempotent, so PUT for an existing node or
profile should replace the node or profile, not throw an error.

Generating an error on duplicate can now be requested using the
If-None-Match header with a `*` value.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:41 -06:00
Jonathon Anderson
a0752a5bd0 Simplify overlay mtime api and add tests
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:22 -06:00
jason yang
a3dbf6aeee add node overlay buildtime
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2025-07-28 18:18:13 -06:00
Jonathon Anderson
a2c7caa4ba Rebuild overlays for discovered nodes
- Fixes: #1468

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-09 14:29:38 -06:00
Tobias Ribizel
470b7d7519 add newline to docstring
Signed-off-by: Tobias Ribizel <mail@ribizel.de>
2025-07-07 15:50:43 +02:00
Tobias Ribizel
301082cdd7 add docstring for node patterns
Signed-off-by: Tobias Ribizel <mail@ribizel.de>
2025-07-06 16:36:45 +02:00
Christian Goll
2e860c3462 changed SetId() to setId() 2025-07-02 13:51:07 +02:00
Jonathon Anderson
db3a3fee05 Additional overlays to support provision-to-disk without ignition
- sfdisk - partitions the disk
- mkfs - formats partitions
- mkswap - formats partitions for swap
- systemd.mount - explicit creation of systemd mount units
- systemd.swap - explicit creation of systemd swap units

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-06-30 23:24:20 -06:00
Jonathon Anderson
b98eae4b01 Refactor ignition support during dracut
- 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>
2025-06-30 23:19:31 -06:00
Christian Goll
b8641b8569 more variables for the grub templates
Signed-off-by: Christian Goll <cgoll@suse.com>
2025-06-17 01:34:23 -06:00
Jonathon Anderson
7d437e9e58 Merge pull request #1925 from MatthewHink/mhink-ovl
Add uid, gid, and permissions to OverlayFile struct
2025-06-16 17:13:20 -06:00
Jonathon Anderson
f61dfdde87 Use jsonassert in test
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-06-16 17:09:34 -06:00
MatthewHink
b6c33d9567 Add uid, gid, and permissions to OverlayFile struct
There is an existing test for this. uid, gid, and permissions seem
consistent across test boxes.
2025-06-16 17:09:24 -06:00
MatthewHink
0a1d12e6d4 Fail API add node if node exists 2025-06-13 12:22:03 -07:00
Jonathon Anderson
b5d72fb393 Address unhandled deadcode issues
- Fix `make deadcode` to properly fail GitHub checks
- Resolve "dead" code by refactoring other code to use it

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-05-10 11:26:11 -06:00
Matt Hink
be73ac056a Initial cut for removing the old API.
Remove API reverse proxy server and google dependencies.
Remove API config.
Remove API client.
Remove API GRPC server.
Remove unused ImageCopy function. image.Duplicate is used.
Update Makefile to avoid protobuf builds.

Signed-off-by: Matt Hink <mhink@ciq.com>
2025-05-10 10:58:03 -06:00
Jonathon Anderson
4005afac4c Add a new OpenAPI v3 REST API to warewulfd at /api
Co-authored-by: jason yang <jasonyangshadow@gmail.com>

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-04-03 07:12:03 -06:00
Christian Goll
eb9a20fa01 fix SUSE specific udev regression
Signed-off-by: Christian Goll <cgoll@suse.com>
2025-04-02 20:39:41 -06:00
Jonathon Anderson
51786b5e4a Fix a panic during wwctl node list --ipmi for nodes with no ipmi configuration. #1847
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-04-01 16:48:43 -06:00
Jonathon Anderson
dd2d256179 wwctl upgrade nodes --replace-overlays avoids applying overlays multiple times
- Closes: #1823

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-03-28 03:49:22 -06:00
Rafael Lopez
ca1830d8e1 Rename value in loop
Rename value from 'node' to 'nodeData' so it doesn't
coincide with the package import name.

Signed-off-by: Rafael Lopez <raflopez1@gmail.com>
2025-03-25 19:21:30 -06:00
Rafael Lopez
299f1db41c fix import from yaml where node does not pre-exist
Check if node exists, if not add it first before
attempting SetNode().

Fixes: #1842
Signed-off-by: Rafael Lopez <raflopez1@gmail.com>
2025-03-25 19:21:30 -06:00
Jonathon Anderson
09488db3f6 Fix processing of UNDEF and UNSET during wwctl <node|profile> set. #1837
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-03-25 18:16:14 -06:00
Jonathon Anderson
4367b56120 Restore some default behaviors
- If `init` is not specified, wwinit looks for /sbin/init, /etc/init,
  and /bin/init, matching dracut behavior.
- assume ipxe template=default if not set
- Display a warning during overlay build if an overlay list is empty

Issues:

- Closes: #1808
- Closes: #1813

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-03-25 09:07:03 +01:00
Jonathon Anderson
605c910c82 Update nodes and profiles when renaming an image. #1637
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-03-24 21:45:06 -06:00
Jonathon Anderson
c7bda5e655 Add tests for overlay import --overwrite
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-03-21 23:42:30 -06:00
Shane Nehring
e152db228c Adding quotes around escapechar in ipmitool.tmpl
- Fixes: #1802

Signed-off-by: Shane Nehring <snehring@iastate.edu>
2025-03-21 16:41:36 -06:00
Jonathon Anderson
3919dea887 Fix display of dotted field names
- Fixes: #1825

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-03-19 02:59:47 -06:00
Jonathon Anderson
06f2c0dc5a Properly configure a default IPMI template during wwctl upgrade nodes --add-defaults
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-03-19 02:20:48 -06:00
Christian Goll
ea9a013812 Handle missing ipmi fields during bmc commands
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-03-18 15:33:35 -06:00
Christian Goll
a4035faff9 Fix warewulfd panic when netdev is only in profile
Signed-off-by: Christian Goll <cgoll@suse.com>
2025-03-18 10:55:24 -06:00
Christian Goll
fafaaf9675 add failing test for #1817
Signed-off-by: Christian Goll <cgoll@suse.com>
2025-03-17 11:05:34 +01:00
Jonathon Anderson
c8c9442178 Change upgraded default kernel args to match distributed nodes.conf
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-27 02:03:26 -07:00
Jonathon Anderson
94b2c3ba84 Add support for ubuntu-style dracut image names
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-25 17:01:26 -07:00
Jonathon Anderson
9cedd835aa Port NFS before applying defaults
- Closes: #1758

Fixes an issue where `wwctl upgrade nodes` applied default NFS mounts and
ported in NFS entries from warewulf.conf.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-23 16:33:14 +01:00
Christian Goll
b41a49f863 Merge pull request #1762 from anderbubble/wwbool-default-true
Add WWbool.BoolDefaultTrue()
2025-02-23 16:30:40 +01:00
Jonathon Anderson
fd8de8bfab Add WWbool.BoolDefaultTrue()
New support in WWbool for booleans that default "true."

Used primarily for NetDev.OnBoot.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-20 01:41:10 -07:00
Jonathon Anderson
279e966ce2 Reduced default verbosity of wwctl overlay build
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-20 01:40:36 -07:00
Jonathon Anderson
fd49254ac5 Display auto-detected kernel version during iPXE and GRUB
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-18 17:00:21 -07:00
Jonathon Anderson
4fa8601b75 Updated wwinit for clarity #1156
Also:

- Renamed /warewulf/wwinit to /warewulf/prescripts

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-17 02:48:16 -07:00
Jonathon Anderson
fb9f269fc5 Update ipxe and grub configuration for clarity #1156
Also:

- Defined a menu for iPXE
- Support a IPXEMenuEntry tag to select the boot method
- Merge iPXE dracut support into default.ipxe (use IPXEMenuEntry=dracut)

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-17 02:31:05 -07:00
Christian Goll
34e8aa7402 Merge pull request #1746 from anderbubble/default-nfs-resources
Default nfs resources
2025-02-18 17:42:24 +01:00
Jonathon Anderson
d96744afbd Make DHCP range optional
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-14 23:32:22 -07:00
Jonathon Anderson
f2273fcd4a Removed check for "discoverable" profiles during wwctl upgrade nodes
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-14 20:45:39 -07:00
Jonathon Anderson
b05fa4157a Added fstab mounts for /home and /opt to initial default profile
- Closes: #1744

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-14 20:30:46 -07:00
Jonathon Anderson
8197484461 Make wwctl image syncuser --write true by default
It can be disabled with `wwctl image syncuser --write=false`.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-11 18:28:49 -07:00
Jonathon Anderson
01b3c28874 Update syncuser to read passwd and group from sysconfdir
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-11 18:28:49 -07:00
Jonathon Anderson
f2092b2854 Remove syncuser warning messages in wwctl that assume its use
- #1321

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-11 18:28:49 -07:00
Jonathon Anderson
21333482e6 Omit duplicate passwd and group entries in syncuser overlay
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-11 18:28:47 -07:00
Christian Goll
2211df64eb Merge pull request #1728 from anderbubble/fix-1718
Updated `wwctl node export` to include node IDs
2025-02-12 09:20:41 +01:00