Commit Graph

79 Commits

Author SHA1 Message Date
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
Jonathon Anderson
a602971146 Avoid reporting an empty "from" value
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-01-17 23:12:35 -07:00
Christian Goll
d6ef1a86ce prpfiles can be exluded with ~ prefix
Used the ~ as prefix as ! will mess up with yaml syntax

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-01-17 22:04:05 -07:00
Christian Goll
85eaa20708 overlays from different profiles are merged
If a node contains several profiles and these profiles have
overlays attached, these profiles are now merged. Overlays
can't be excluded as this can not be displayed to the user

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-01-17 21:51:05 -07:00
Christian Goll
a7df560a30 Add json output for ignition
Signed-off-by: Christian Goll <cgoll@suse.com>
2023-08-21 16:19:13 -06:00
Christian Goll
45539a0d1f Recursive handling for command line flags
Every struct in a NodeConf with `lopt:"foo" set is now added as a
command-line flag with the RecursiveCreateFlags call. For maps a struct
with the key UNDEF is added so that it can be parsed out.

As the flags for the command-line need variables which hold the values,
for every map an element map[UNDEF] is added.  When now calling the
internal add, these map element can be filtered out and replace by the
given name. (e.g., --netname)

* rewrote node/profile add for recursive functions
* rewrote node/profile set for recursive functions
* rewrote node/profile list for recursive functions

Signed-off-by: Christian Goll <cgoll@suse.com>
2023-08-21 16:19:13 -06:00
Christian Goll
c55c5a2ac4 Add recursive setter functions
when transforming a NodeInfo struct to a NodeConf (set the NodeConf from
the NodeInfo) nested structures were seperately handled. This means a
there were seperate handles for e.g *Netdevs and *IpmiConfig. The new
getter traverses through the datastucture and sets the right value for a
Entry struct, but calls itself again if a Pointer is detected.

This adds the posiblity to add new nested structures to NodeConf and
NodeInfo without the need of seperately handling them in the transformer
functions.

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-08-21 16:19:13 -06:00
jason yang
15d4ccb34d add sort support for returned slice
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-05-12 02:47:53 +00:00
Christian Goll
96644be621 allow UNSET for IP addresses
added more tests for GetFrom
allow UNSET and handle empty hwaddr

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:17:38 +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
4750f96cc6 main_tests are not working as expected
The global values which store the flags are not regenerated during test

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:11:01 +01:00
Christian Goll
4f0ad749d1 Merge pull request #639 from mslacken/DefaultNetwork
use default not override for single network entry
2023-02-03 11:54:01 +01:00
Christian Goll
ae4fb41722 without nested if else 2023-01-12 10:37:19 +01:00
Christian Goll
db863b99c5 use default not override for single network entry 2023-01-11 10:08:05 +01:00
Christian Goll
12460caa04 just return negated checks 2023-01-10 16:20:52 +01:00
Christian Goll
626b9769ac also handle default value 2023-01-09 11:57:11 +01:00
Christian Goll
7a88ff239f checking only for false outcome 2023-01-05 11:03:08 +01:00
Christian Goll
a4a80e0268 GetB must not ignore altvalue 2023-01-04 14:03:02 +01:00
Christian Goll
79ed2a33ff added simple test for transformer.go 2022-11-29 14:30:41 +01:00
Christian Goll
35529527bb added init function for empty NodeInfo 2022-11-11 14:59:15 +01:00
Christian Goll
4fe584547b Merge branch 'development' into wwlog-newlines 2022-10-13 14:46:03 +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
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
Christian Goll
b485ea999f removed optionStrMap in favor of NodeConf
openStrMap is a map[string]string which is sent arround. This is now
done by using a unmarshalled NodeConf instead.
2022-08-18 19:22:55 +02:00
Christian Goll
0ca17dd454 using functor for Get and GetReal 2022-08-16 15:38:07 +02:00
Christian Goll
8c2d40881d use reflect on overlays 2022-08-10 17:09:10 +02:00
Christian Goll
41d12888ab reflections for unmarshal 2022-08-10 14:16:48 +02:00
Christian Goll
d819eef792 tags for ipmi and kernel 2022-08-04 20:07:24 +02:00
Christian Goll
925a5a2155 Fix node set 2022-07-26 12:01:13 +02:00
Christian Goll
99e9316011 restore old node list 2022-07-20 12:13:19 +02:00
Christian Goll
e23f794166 simplified node list command 2022-07-19 17:21:27 +02:00
Christian Goll
510f6a60a9 added excludellist to CreateFlags 2022-07-14 10:40:46 +02:00
Christian Goll
e0c62a81a4 testing profile set 2022-07-14 10:35:27 +02:00
Christian Goll
59141a6dac change network hadnling 2022-07-13 11:52:24 +02:00
Christian Goll
c8d70e23ad rebased on new API 2022-07-11 16:34:08 +02:00
Christian Goll
a37fa71de0 add explicit set of netname 2022-07-07 11:38:19 +02:00
Christian Goll
8902f08c87 added hangling of map[string]*struct 2022-07-07 11:37:18 +02:00
Christian Goll
84d3b72f63 added more abstrac setter for nested structs 2022-07-07 11:29:58 +02:00
Christian Goll
f5b6287486 Explicit setter func at complie time 2022-07-07 11:29:19 +02:00
Christian Goll
3ced0e2836 add brackets for PrintB if its default 2022-06-23 12:35:19 +02:00
Christian Goll
28de9f5220 addnil to remove option 2022-06-08 16:20:17 +02:00
Christian Goll
04551ef264 for removing a value an empty string is needed 2022-06-08 16:16:52 +02:00
jcsiadal
dbd747788f wwctl profile fixes
Signed-off-by: jcsiadal <jeremy.c.siadal@intel.com>
2022-04-19 21:59:34 +00:00
Christian Goll
edc7c04bc2 PrintB returns string 2022-04-14 11:43:02 +02:00
Christian Goll
4782d7e726 fixup profile handling 2022-04-11 14:41:43 +02:00
Christian Goll
fa052a0f57 simplified GotReal 2022-04-08 15:15:16 +02:00
Christian Goll
49bb9a40f0 reserve memory ofr kernel and ipmi entry 2022-04-08 14:47:19 +02:00
Christian Goll
c0f7ecf357 store the ovelats as yaml list 2022-03-24 19:45:51 +01:00