Commit Graph

25 Commits

Author SHA1 Message Date
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
Jonathon Anderson
73f34d0099 Restore server network auto-detection
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-06 20:46:20 -07:00
Jonathon Anderson
2e1466fc7e Fix handling of CIDR values in warewulf.conf
- Fixes: #1541
- Fixes: #1594

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-06 20:46:20 -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
e80c639b11 Convert config to *bool
Supports leaving booleans unspecified in YAML.

Boolean methods allow the templates to continue using previous names for
boolean values.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:09:48 -07:00
Jonathon Anderson
b37d49d6de Support upgrading warewulf.conf
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:09:45 -07:00
Jonathon Anderson
76acd8ff80 Rename RootConf to WarewulfYaml
Matches the new name of NodesYaml

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:09:01 -07:00
Jonathon Anderson
a7325b6ffa Remove WW_INTERNAL
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:08:54 -07:00
Christian Goll
0dd0317740 replaced errors.Wrap with fmt.Errorf
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-11-07 22:57:29 -07:00
Jonathon Anderson
ad7582692c Omit the wwclient section from warewulf.conf if empty
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-06 19:07:06 -07:00
Christian Goll
5bd4fd4712 use yaml/v3 and don't export Nodes
introduced wwbool and don't export
Nodes and NodeConfs. This requires new
explict Yaml (un)marshaling as the standard
marshaller won't touch these fields

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-17 15:30:54 -04:00
Tobias Poschwatta
971d9e2118 Add option for wwclient port number
With this change, you can specify a port number for wwclient.
If

  wwclient:
    port: NUMBER

is specified in warewulf.conf, wwclient will bind to the specified local
port NUMBER. If no port is specified, wwclient will use any available
port, or port 987 if secure is true.

Port 987 is in the default port range used by the Linux NFS client
(665-1023, see linux/include/linux/sunrpc/xprtsock.h). Changing
the port can avoid failures when port 987 is already in use.

Signed-off-by: Tobias Poschwatta <poschwatta@zib.de>
2024-08-02 11:09:16 +02:00
Christian Goll
0eba837950 use warewulf.conf from parent on child
The directories for the overlays needed for the bind
mount are now created under conf.Paths.WWChrootdir/$CONTAINERNAME
with the pattern $CONTAINERNAME-run-xxxxxx. This pattern can be
used as lock, so that there can't be congruent shell/exec calls
to the same container.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-06-06 16:46:10 -04:00
Xu Yang
b3d8f9ccc5 add CIDR format to warewulf.conf parse
Signed-off-by: Xu Yang <xyang@ciq.com>
2024-05-31 23:36:35 -06:00
Christian Goll
21150d2975 make created ssh keys configureable
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-05-01 14:27:39 -06:00
Xu Yang
74480ab494 fix the bug that configuration expects CIDR format
Signed-off-by: Xu Yang <xyang@ciq.com>
2024-01-30 21:20:10 -07:00
Jonathon Anderson
a1832ad8c1 Complete transfer of Warewulf from HPCng
Warewulf is now being maintained in its own GitHub organization at
github.com/warewulf

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-01-26 21:35:04 -07:00
Christian Goll
6e5013a359 fix SIGSEV if build host has no network
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-06-13 11:30:15 +02:00
Jonathon Anderson
e2e3a90623 Revert some caps changes
Use in templates means these were an accidental interface change.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
8321193645 Refactor and document config/datastructure
Also adjusted case for initialisms (e.g., DHCP, TFTP, NFS).

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
cfdf179e16 Remove SetDynamicDefaults from Parse
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
387cd0f7be Refactor BaseConf Read and Parse
Also refactor New and Get to return pointers to match BaseConf methods.
This makes calling the methods immediately on the return values of the
constructors easier.

Also move config.ConfigFile to buildconfig.go.in. ConfigFile is still
used by wwctl as a default config file to reference; but it is removed
from other locations now.

Removed Persist, as nothing called it.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
af6c91ade3 Rename BaseConf.Initialized to BaseConf.InitializedFromFile
Initialized could be interpreted to mean dynamically initialized as
well. This new name removes that ambiguity.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
70292276e2 Rename BaseConf.New to BaseConf.Get
Since BaseConf.New could return a cached BaseConf, rather than always
constructing a new struct, I've renamed it to Get to more accurately
reflect its use. A new New() method is called by Get and always
initializes a new struct.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
f78e6b73b1 Rename ControllerConf to BaseConfig
Also moved BaseConfig to a new source file, co-located with its
constructors and methods, and added doc comments.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00