Commit Graph

99 Commits

Author SHA1 Message Date
Jonathon Anderson
a8554b0af5 Replace olekukonko/tablewriter with cheynewallace/tabby
- Closes #1497
- Closes #1498

This library is simpler and doesn't produce extraneous whitespace around
the output.

A local helper function restores "--" for empty output.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-07 22:44:50 -07:00
Jonathon Anderson
fcc15eb8ef Fix boolean pointer handling
- Refactor field reflection for clarity
- Update tests for clarity

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-10-31 15:52:01 -06:00
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
Jonathon Anderson
0be1e8464a End-line whitespace cleanup
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-10-17 23:11:33 -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
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
Jonathon Anderson
053dd9953a Split overlays into discrete functionality and test
- Closes #987

To make the overlays testable in isolation, and after discussion with
the TSC, removed host/time/source from overlay files.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-09-26 10:48:38 -06:00
Jonathon Anderson
e99e8c3dbb Update use of wwlog.Info to specify a format string
Since wwlog.Info() expect a format string, accidental inclusion of a
format string in the payload causes an error.

See also #1382, #1363

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-09-25 13:49:11 -06:00
xu yang
aa8282ad10 Fix excessive line spacing issue when listing nodes
Signed-off-by: xu yang <xyang@ciq.com>
2024-09-25 13:49:08 -06:00
Jonathon Anderson
4a5c1cad12 Simplified slice ordering fix and extended for runtime overlay
- Extends #1357
- Fixes #1259

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-09-04 19:59:59 -06:00
xu yang
bfa6ad6be8 add test case
Signed-off-by: xu yang <xyang@ciq.com>
2024-09-04 17:10:50 -06:00
Christian Goll
fc80c4745c add various tests for wwctl node list -a
Altough getting and setting values is correct, `wwctl list -a`
will print superseded values as a list and mark them not as
superseded. Tests will fail after this commit.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-04-19 22:24:54 -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
b3638ac1ff failing test for node list without network
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-02-21 10:34:03 +01: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
Jonathon Anderson
5d6ef1882d Remove whitespace damage
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-01-21 00:18:38 -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
jason yang
40583b4713 fix kernelargs are not printing properly in node list output
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-05-25 01:21:49 +00:00
jason yang
b5b62206c1 add one more case
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-05-09 06:12:31 +00:00
jason yang
59390b4dda node/profile list syntax doesn't support comma-separated values
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-05-09 05:30:35 +00: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
b6e6795dee Removed "glob" from node pattern description
A glob is a pattern that supports * and ? wildcards. This is not
supported for node patterns. I'd call these "hostlist" patterns; but
easier to just leave it generic for now until and unless there is
documentation to refer to on the website about the pattern type.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-16 20:58:39 -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
7265083ed0 added test for node list
Signed-off-by: Christian Goll <cgoll@suse.com>
2023-03-28 20:56:12 +02:00
jason yang
522c3478fb use tablewriter to format the output
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-03-23 02:44:59 +00: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
41d12888ab reflections for unmarshal 2022-08-10 14:16:48 +02:00
Christian Goll
ed5b2bbf35 using tag instead of key 2022-08-03 13:44:12 +02:00
Christian Goll
96731a4b87 node list imporvement 2022-08-03 11:47:25 +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
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
jcsiadal
9b6b93a5cb Rename default to primary in src
Signed-off-by: jcsiadal <jeremy.c.siadal@intel.com>
2022-05-05 03:13:21 +00:00
Gregory Kurtzer
c95c518dde Align boolean prints 2022-04-27 22:33:34 -07:00
Christian Goll
edc7c04bc2 PrintB returns string 2022-04-14 11:43:02 +02:00
Christian Goll
f9848455c7 output ipmi write status 2022-04-14 11:29:24 +02:00
Christian Goll
95050a44ce add user defined keys for networks/netdev
Every network in the profile and for the nodes can have induvidual keys values
pairs, called Tags, which are propergated to the templates. So they can be used
for things like MTU size like
  `wwct node set node01 --nettag mtu=9000`
and in in ifcfg.xml.ww
```
{{ if $netdev.Tags.mtu -}}
<mtu> {{ $netdev.Tags.mtu }} </mtu>
{{ end -}}
```
2022-04-06 21:36:17 +02:00
jcsiadal
bfde70cf8a Error free lint
Signed-off-by: jcsiadal <jeremy.c.siadal@intel.com>
2022-04-04 17:01:11 +00:00
Christian Goll
4fc56e2cd0 fixed lint 2022-03-15 16:03:53 +01: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
1203186194 Support kernel overrides from the host or other containers 2022-02-17 07:37:04 +00:00
Gregory Kurtzer
104bc7527d Restored deleted kernel components for overrides 2022-02-17 06:21:40 +00:00
Gregory Kurtzer
5a0c13225e Utilize containerized kernel and remove kernel Support 2022-02-15 06:49:24 +00:00
Gregory Kurtzer
ffaf794a42 Changed "key" paramaters to tags and cleaned up interface 2022-02-11 05:52:46 +00:00