Commit Graph

57 Commits

Author SHA1 Message Date
Jonathon Anderson
30ac144044 Restored profile list tests and resolved exposed bugs
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-10-17 23:58:37 -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
4c8a07f1dc changes for yaml/v3 for wwctl commands
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-17 15:30:54 -04:00
Christian Goll
ac6cd69ca6 fix test to run without NodeInfo
Also removed --fullall from node list and profile list

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-17 15:30:47 -04:00
Christian Goll
457c7c16b1 wwctl commands without NodeInfo
mostly remove Get and calls for the id

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-17 13:35:42 -04:00
Christian Goll
17a5aaefee added more aliases for wwctl commands
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-03-20 21:11:14 -06:00
Christian Goll
1fca0057d3 updated WW_INTERNAL to 45 for 4.5.x release
Internal version update is necessary as new structures were added,
most obviously the disk, partitions and file system structures.
Old configurations will work as expected.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-02-16 20:12:51 -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
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
Jonathon Anderson
82520c0de0 Fix linter errors in some tests
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
c461e65a98 Rename pkg/warewulfconf to pkg/config
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
e693ca9cd4 Merge remote-tracking branch 'jason/issue/658' into development
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-16 18:43:59 -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
5f5724c8a9 Merge branch 'development' into RefactorFlags 2023-04-11 14:17:13 +02:00
Christian Goll
b4acf0fdf2 added hash check for node edit
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-24 19:47:22 +01:00
Christian Goll
366113bf65 Merge branch 'RefactorFlags' into development
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:24:47 +01:00
Christian Goll
12e462afa1 added parsing tests
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:17:54 +01: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
2410a8194c wwctl node add without global variables
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:11:01 +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
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
d34e496d42 wwctl node add without global variables
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-08 12:33:05 +01:00
Christian Goll
d3af143a5b 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-07 17:01:57 +01:00
Christian Goll
3367b67b9f added a test for wwctl node add
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-07 09:05:29 +01:00
Christian Goll
255ff61dc8 adding netname option back 2022-08-31 17:05:28 +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
d252b974bf Fix Nodeadd with ipaddr count 2022-07-21 08:41:36 +02:00
Christian Goll
26fff30897 node add with all options now 2022-07-18 14:42:00 +02:00
Christian Goll
d10b4c352f new apinode namespace in wwapid 2022-07-13 16:05:16 +02:00
MatthewHink
d8cd6049ac Initial cut of wwapi.
We need an API for Warewulf in order to automate around it. The initial version of the API will look a lot like wwctl. wwctl will call the API so that we do not need to maintain separate code paths. In this preview wwctl calls the API via direct function call, but we can change that to a gprc or REST call to a Warewulf server in the future.

This commit contains:
wwapid WareWulf API Daemon. A grpc server with mTLS auth.
wwapic WareWulf API Client. A grpc client with mTLS auth. It's just a sample that reads the version from the server.
wwapird WareWulf API Rest Daemon. A http REST reverse proxy to wwapid.
There are also sample insecure and secure curls to test with.

Implemented Functionality:
wwctl node add
wwctl node delete
wwctl node list
wwctl node set
wwctl node status
wwctl container build
wwctl container delete
wwctl container import
wwctl container list
wwctl container show

Some notes on the files:

    Logic that was in wwctl has moved to warewulf/internal/pkg/api. wwctl just calls the API. wwctl functionality is unchanged.
    Everything under the /google directory is copied google proto code to stand up wwapird. It's a bit strange to copy in the code, but that is currently how it's done.
    Everything in warewulf/internal/pkg/api/routes/wwapiv1 is generated code.

There are some loose ends here, such as no service installers. I just ran off the command line for development.
The Makefile could use improvement. I'm building by make clean setup proto all build wwapid wwapic wwapird ; echo $?
I copied the configs from warewulf/etc to /usr/local/etc/warewulf manually.
2022-06-24 08:39:30 -07:00
Carter Dodd
379faad51d Refactor of server, logging, building of images, template updates
* Combine provision response handling, add hwaddr and interface to dhcp
* Simplify stage cases, add backward compatible uri parse
* Move control of image compression to client
* Fix kernel search path for ubuntu, buffer template generation
* Implement cpio and gz as functions, add log named functions
* Generalize fs image creation routine
* Combine daemonLogf to generalized wwlog
* Fix template newline insertion, update dhcp and hosts tmpl
* Update IPXE template to handle non-compressed files
* Update DHCP template to set network interfaces and server IP assignment
* Update DHCP/hosts templates to choose a host-name self-consistently
2022-05-13 16:52:59 -05:00
Christian Goll
55bf1695de initial commit of simple ipv6 support
As soon as in warewulf.conf a value for ipaddr6 is defined
all nodes will get a derived ipv6 address if not the ipv6
is not explicitly set.
2022-03-15 15:57:35 +01:00
Gregory Kurtzer
39ec7c0807 A few usability fixes and put full node DB logic into warewulfd 2021-12-31 02:38:48 +00:00
Gregory Kurtzer
938511e9cd Merge branch 'main' of github.com:gmkurtzer/warewulf into netdev_refactor 2021-12-28 15:17:21 -08:00
jcsiadal
0b93d6c277 Update help
Signed-off-by: jcsiadal <jeremy.c.siadal@intel.com>
2021-11-08 11:36:21 -08:00
Gregory Kurtzer
498515f7b5 Minor usability fixes in network config 2021-10-23 12:25:51 -07:00
Gregory Kurtzer
1370932cd3 Introduction of netname functionality for network devices 2021-10-23 07:12:57 -07:00
Gregory Kurtzer
51c15f3c39 Update CLI to all use the new expand bracket capability 2021-10-15 21:37:47 -07:00
WestleyR
705b321f80 Better error handling for some of wwctl commands
Better error handling, also prints a stack trace for `wwctl` if
`--debug` flag is used.
2021-09-10 21:18:45 -07:00
WestleyR
4edc16953e Fix linting issues 2021-09-07 20:48:51 -07:00
Gregory Kurtzer
a82e1b0ea5 Fixed formatting across entire project 2021-08-21 08:04:47 -07:00
Niko Kivel
cba1e926f9 fixed n.Id.Get() in wwlog.VERBOSE 2021-05-14 15:12:38 +02:00
Niko Kivel
16db64f9dc removed group and controller, added ClusterName 2021-05-14 15:08:58 +02:00
Niko Kivel
3308e76083 NIC type for node-->add 2021-03-26 10:38:31 +01:00
Ian Kaneshiro
846b45524c Tidy up
- Ran goimports to format code and imports
- Removed unused module from go.mod
- Added .editorconfig to keep formatting standard across contributors
2021-02-16 11:54:12 -08:00
Gregory Kurtzer
72b1d8c9d8 UI Updates with a few minor fixups scattered here and there 2021-01-14 20:23:42 -08:00
Gregory Kurtzer
62a1abaab3 Cleanups and minor fixups 2020-12-13 22:45:08 -08:00
Gregory Kurtzer
8c11c2b304 Renamed vnfs to container, finished VNFS and kernel refactoring 2020-12-06 00:47:00 -08:00