Commit Graph

118 Commits

Author SHA1 Message Date
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
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
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
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
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
a844379bc5 Merge --kerneloverride into --kernelversion
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-09 10:02:28 +01:00
Jonathon Anderson
8f21d54243 Refactor kernel support
- Remove kernel imports and kmods images
- Repurpose KernelOverride as container path
- Support Kernel.Version as version prefix for kernel selection
- Compare initramfs by version

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-09 10:02:22 +01:00
Jonathon Anderson
fdbdf88df0 Rename NodeConf to NodesConf
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:09:02 -07:00
Jonathon Anderson
a2c778b7ee Remove ExportedYml
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:08:59 -07:00
Jonathon Anderson
8a602e8a76 Return OnBoot to wwtype.WWbool
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:08:55 -07:00
Jonathon Anderson
a7325b6ffa Remove WW_INTERNAL
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:08:54 -07:00
Jonathon Anderson
ab293d88ea Fix extraneous whitespace in flag definition
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:08:52 -07:00
Jonathon Anderson
0665d5dc88 Refactor node
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:08:47 -07:00
Jonathon Anderson
9ddb491ba3 Rename BmcTemplate to Template
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-07 23:01:32 -07:00
Christian Goll
10ea0ac78d use ipmi interface from node.NodeConf
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-11-07 23:01:32 -07:00
Jonathon Anderson
093c74add4 Remove unused IsZero function
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-01 18:39:40 -06:00
Jonathon Anderson
bb5d1d17ed Revert NetDevs.Manual back to NetDevs.OnBoot
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-10-17 23:00:57 -04:00
Christian Goll
0c6e7cc58a fixes for split overlays
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-17 15:39:54 -04:00
Christian Goll
c08cd82e68 don't use net.IPMask
net.IPMask doesn't have any advantages, as it would
marshalled to
mask:
  - 1
  - 2
  - 3
  - 4

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-17 15:30:54 -04:00
Christian Goll
342236b9b9 updated test for yaml/v3
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-17 15:30:54 -04: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
Christian Goll
28a7b9fe84 removed NodeInfo and using NodeConf instead
This is a significant change in the undelying data model!

nodeDb, err := node.New()

will result in a structure which contains the on disk
values. Only

nodeDb.FindAllNodes() or nodeDb.GetNode(id) will give
the nodes with its merged in profiles.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-17 13:35:42 -04:00
Christian Goll
76a40f1364 Entry is aware if its ment as a slice or not
This is needed for printing out the values, as at this part in the
code there is no access to the NodeConf and only there the information
if the Entry is ment as a slice or not is available.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-04-19 22:28:05 -06:00
Xu Yang
16183e603c add multiple formats support
Signed-off-by: Xu Yang <xyang@ciq.com>
2024-03-19 01:48:08 -06:00
Christian Goll
4379c4c18d use grub/shim from host system
Also the boot method is now configured globaly as this is
the only way to make sure that unkonwn nodes get the right
stuff

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-01-17 18:02:04 -07:00
Christian Goll
03ef7447e9 copy shim/grub on default profile container change
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-01-17 18:02:04 -07:00
Christian Goll
a36cb23319 added shim/grub find to provision process
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-01-17 18:02:04 -07:00
Jonathon Anderson
64d0d54c92 Fix some formatting errors with make fmt
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2023-12-08 21:18:14 -07:00
Andreas Skau
10976a7e5d Delinted 2023-12-04 15:58:26 +01:00
Andreas Skau
214848c75e Add IPMI escape char functionality 2023-12-04 15:42:01 +01:00
Jonathon Anderson
42842aeee1 Format entire source code using make fmt
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2023-10-23 17:56:20 -06:00
Christian Goll
c3a4eba514 Disable per-netdev primary flag
Primary network devices are now identified by a per-node attribute,
rather than a per-netdev boolean. While the legacy data can still be
parsed, the argument for setting the per-netdev boolean at the
command-line is no longer available.
Correct behavior is tested.

Signed-off-by: Christian Goll <cgoll@suse.com>
2023-09-13 11:31:04 +02:00
Christian Goll
f2bc70ad00 Add structures for devices and filesystems
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-08-21 16:19:13 -06:00
Jonathon Anderson
2319906d97 Fix writing of nodes.conf
The caching functionality of nodes.conf, and the optional persistence
functionality that came with it, appears to have been preventing
actually writing the configuration to disk in all cases. This change
fixes the ability to write to nodes.conf.

Somewhat opinionatedly, this change removes the caching functionality of
nodes.conf. The tests have also been updated to use real files for i/o
rather than tying into the caching system, making them more accurately
test the ability of Warewulf to actually read and write its
configuration.

Fixes #779

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-14 10:53:31 -06:00
Christian Goll
b0602133ec use netParseIP and ParseMAC
check also MAC addresses and common formating

Signed-off-by: Christian Goll <cgoll@suse.de>

reformat ipaddr for test coverage

fixed processing of default values

updated transformer tests

correct behavior for tags

add tests for tags

new tests for primary network

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:17:07 +01:00
Christian Goll
13bc378a6b Refactor the CreateFlags command
* added the additional type flag, which can be bool,IP
* UNDEF is recognized for the bool flag
* 0.0.0.0 must be used as UNDEF for IP flag

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:15:50 +01:00
Christian Goll
c1e2100322 added a test for wwctl node add
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:10:29 +01:00
Christian Goll
c6b65bc853 set the primary network in NodeInfo not in NetDev
Prior the primary was a boolean attribute of NetDev, so several
NetDevs could have been primay. Setting is as a sting in NodeConf
assures that only one network could be primary.
If no primary network is set, a valid altvalue will be set.
2023-02-10 10:46:01 +01:00
Christian Goll
4fe584547b Merge branch 'development' into wwlog-newlines 2022-10-13 14:46:03 +02:00
Christian Goll
33504354c2 Merge branch 'development' into node-edit 2022-10-13 09:59:38 +02:00
Christian Goll
6ff4839b0f Merge pull request #549 from mslacken/add-mtu
added mtu
2022-10-12 21:30:07 +02:00
Christian Goll
9e41de9fdf adde mtu 2022-09-30 16:26:14 +02:00
Christian Goll
7087f3e4a1 add edit command for direct edit of node entries 2022-09-16 16:51:07 +02:00
Jonathon Anderson
0b3e862bea Remove trailing newline from wwlog
I noticed that some wwlog calls included a trailing newline, but others
did not. I tested both in isolation and discovered that the behavior was
consistent regardless of whether a trailing newline was included. I
further confirmed in code that wwlog appends a trailing newline
automatically if it is not present; so a trailing newline is unnecessary
in individual calls.

This commit removes trailing newlines from all calls to make them
consistent. It also replaces two calls to wwlog.Printf. (see #534)

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2022-09-15 12:38:03 -06:00
Christian Goll
efd761f7c3 Read the defaults for anode from defaults.conf 2022-09-15 11:14:26 +02:00
Jonathon Anderson
22910958b5 Replace all instances of wwlog.Printf
wwlog provides named loggers for each level, which requires
less code and is clearer than wwlog.Printf. The code has
included a mix of both, but this commit consolidates existing
code on the per-level functions.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2022-09-11 08:00:23 -06:00
Christian Goll
255ff61dc8 adding netname option back 2022-08-31 17:05:28 +02:00
Christian Goll
063c781710 recreate CreateFlag based on NodeConf
This will always create the network named default,
so this has to be changed if a new netowk is set
2022-08-19 16:33:46 +02:00