Commit Graph

1524 Commits

Author SHA1 Message Date
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
c2a51c2a7e format and changelog
Signed-off-by: Tobias Ribizel <mail@ribizel.de>
2025-07-07 15:44:11 +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
Jonathon Anderson
2ba6e28215 Remove wwctl node import --csv
- Closes #1862

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-02 21:25:54 -06:00
Jonathon Anderson
48bace55f6 Preserve file permissions during wwctl overlay edit
- Fixes: #1886

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-02 08:06:13 -06:00
Jonathon Anderson
3db131eadf Fix width of wwctl image shell --help
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-02 13:54:56 +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
Jonathon Anderson
680ecfb3fd Minor updates to wwclient log messages
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-06-16 11:02:40 +02:00
MatthewHink
0a1d12e6d4 Fail API add node if node exists 2025-06-13 12:22:03 -07:00
Christian Goll
e72368cd26 fix wwctl profile set for disk/fs/part
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-05-27 13:56:04 -06: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
Jonathon Anderson
1883f2e932 Added a test for wwctl node import
To support this, also added `wwctl node import --yes`.

Also corrected the spelling of `--cvs` to `--csv`.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-03-25 20:00:48 -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
Xu YANG
9e9f37208c Merge pull request #1841 from anderbubble/cobra-nargs
Explicitly enforce the number or arguments accepted by some `wwctl` subcommands
2025-03-25 13:47:14 +09: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
9a3e48fa37 Explicitly enforce the number or arguments accepted by some wwctl subcommands. #1717
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-03-24 21:06:07 -06:00
Jonathon Anderson
e4a9018b80 wwclient uses WW_IPADDR, if set, to contact the Warewulf server.
- Closes: #1788

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-03-22 03:03:21 -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
Timothy Middelkoop
ae54fd207b Add --overwrite to wwctl overlay import
- Closes: #386

Signed-off-by: Timothy Middelkoop <tmiddelkoop@internet2.edu>
2025-03-21 23:42:27 -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
d256d15c20 fixup pdf build
Signed-off-by: Christian Goll <cgoll@suse.com>
2025-03-18 12:21:03 -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
Christian Goll
a97c204f53 Use wwctl overlay <import|build> --workers=0 to indicate default value
By default, uses `runtime.NumCPU()`

The default value is rendered in the generated man pages, which made
their content dependent on build system characteristics.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-03-01 11:46:15 +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