Commit Graph

28 Commits

Author SHA1 Message Date
jason yang
d0b396b89c fix tag ignored issue
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2024-01-24 15:25:48 -07:00
Christian Goll
f8805e87a4 merge tags in GetterFrom
Signed-off-by: Christian Goll <cgoll@suse.com>
2023-11-25 01:54:02 -07:00
Christian Goll
539002088c check if entry has real value in recursive getter
Signed-off-by: Christian Goll <cgoll@suse.com>
2023-10-14 02:52:53 -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
Christian Goll
fdd233a25f Add recursive getter functions
When transforming a NodeConf struct to a NodeInfo (get the NodeInfo from
the Nodconf) nested structures were seperately handled. This means there
were seperate handles for e.g *Netdevs and *IpmiConfig. The new getter
traverses through the datastucture and sets the right value for an 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 seperate handling them in the transformer
functions.

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-08-21 16:19:13 -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
Jonathon Anderson
cb1726bd40 Minor spelling fix
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-01-31 14:57:27 -07:00
Christian Goll
53be931f87 fix tests for fransfomer 2022-11-29 10:53:53 +01:00
Christian Goll
22f9c86c34 create memory for nettags 2022-10-18 10:02:53 +02:00
Christian Goll
33504354c2 Merge branch 'development' into node-edit 2022-10-13 09:59:38 +02:00
Christian Goll
f55c5bf604 lines for better merging 2022-10-13 09:49:49 +02:00
Christian Goll
f1bad3bc39 Added csv import of nodes 2022-10-10 11:06:30 +02:00
Christian Goll
91e032d7a2 added code for setting default values for NetDev 2022-09-30 16:12:03 +02:00
Christian Goll
a4fbe428e2 only show options with lopt 2022-09-23 14:47:17 +02:00
Christian Goll
c3416de3cb fix for go1.16 and possible sigsev 2022-09-19 17:10:06 +02:00
Christian Goll
3cc9e12e69 add yaml strings as comment 2022-09-19 15:23:33 +02:00
Christian Goll
efd761f7c3 Read the defaults for anode from defaults.conf 2022-09-15 11:14:26 +02:00
Christian Goll
18eb531d4b fixed deletion of network and deletion of tags 2022-09-02 16:45:37 +02: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
2016588f36 fallten the Nodes and NodeProfile before write 2022-08-16 17:15:39 +02:00
Christian Goll
0ca17dd454 using functor for Get and GetReal 2022-08-16 15:38:07 +02:00
Christian Goll
b2dc31e20b fixed mergin profiles into nodes 2022-08-12 09:30:16 +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