Commit Graph

1056 Commits

Author SHA1 Message Date
Jonathon Anderson
e609c599a1 Address feedback from Copilot
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-08-27 22:25:21 -06:00
Christian Goll
6f4fd60d8f refactored overlay class
overlay.GetOverlay(name) returns now an error if the overlay doesn't
exist. This is the most canonical way to act if there is no overlay.
2025-08-27 22:24:31 -06:00
Christian Goll
1e54d02f70 Revert "Atomic overlay file application in wwclient"
This reverts commit 9f11b4a2b9.
2025-08-13 09:57:31 +02:00
Jonathon Anderson
9f11b4a2b9 Atomic overlay file application in wwclient
Update wwclient such that each file in the runtime overlay is applied
atomically.

- Closes: #1307
- Closes: #1975
- Closes: #1226

Also adds --once flag to allow wwclient to be run one time.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-08-12 23:16:03 -06:00
Dacian Reece-Stremtan
efd63aecd4 IPv6 iPXE support
* Parse address and port with netip w/ tests
* Add Authority to provisioning templates based on remote IP family
  (name based on RFC 3986)
* Add IPv6 support to the default iPXE (tested)
* Update `grub.cfg.ww` to use Authority (untested)

Co-authored-by: Dacian Reece-Stremtan <dacianstremtan@gmail.com>
Co-authored-by: Timothy Middelkoop <tmiddelkoop@internet2.edu>
Signed-off-by: Timothy Middelkoop <tmiddelkoop@internet2.edu>
2025-08-01 14:46:36 -06:00
Jonathon Anderson
ebc101b2b1 Move reexec.Init() to beginning of wwctl
- Fixes: #1879

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-08-01 01:08:20 -06:00
Christian Goll
2c51ca7fff added warewuld configure option
Co-authored-by: Jonathon Anderson <janderson@ciq.com>
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-31 21:47:08 -06:00
Jonathon Anderson
4b44de6688 Fix wwctl upgrade nodes to handle kernel argument lists
`wwctl upgrade nodes` could convert legacy kernel argument formats to
the new list format, but then wasn't properly parsing the new list
format for repeat runs.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-31 19:01:47 -06:00
Jonathon Anderson
7d0b73e452 Address copilot review from #1945
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:57:01 -06:00
Jonathon Anderson
5ceeb60c24 Refactor wwapi tests for proper isolation
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:48 -06:00
Jonathon Anderson
e149a332e6 Bugfix: cloning a site overlay when parent dir does not exist
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:48 -06:00
Jonathon Anderson
749e79b7ec Clone to a site overlay when adding files in wwapi
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:48 -06:00
Jonathon Anderson
9884aad504 Consolidated createOverlayFile and updateOverlayFile to addOverlayFile
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:48 -06:00
jason yang
62d1aa654d Support for creating and updating overlay file in wwapi
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2025-07-28 18:18:48 -06:00
Jonathon Anderson
7b2c0901ed Only return overlay files that refer to a path within the overlay
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:48 -06:00
jason yang
e089fe0101 add overlay file deletion support
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2025-07-28 18:18:48 -06:00
Jonathon Anderson
6b5115934b DELETE /api/overlays/{id}?force=true can delete overlays in use
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:48 -06:00
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