Commit Graph

630 Commits

Author SHA1 Message Date
xu yang
cd0ef5c4a8 fix the issue when node edit deletes node when warewulfd is not running
Signed-off-by: xu yang <xyang@ciq.com>
2024-01-30 17:10:52 -07:00
xu yang
7746854732 Fix error when editing node
Signed-off-by: xu yang <xyang@ciq.com>
2024-01-30 17:10:52 -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
jason yang
c0b9c0996a move hostlist code into internal folder
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2024-01-24 22:00:07 -07:00
Jonathon Anderson
69e9cf7e85 Merge pull request #1022 from JasonYangShadow/issue/583
add container rename support
2024-01-24 19:59:41 -07:00
jason yang
d0b396b89c fix tag ignored issue
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2024-01-24 15:25:48 -07:00
Jonathon Anderson
eded560cbc Use "mv" as the alias for "rename"
The `mv` command is typically used to rename files in a Linux
environment, so keep that convention here for container rename.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-01-24 15:11:21 -07:00
Jonathon Anderson
acfd70a645 Return an error if rename arguments != 2
The original implementation presented a warning if more than two
arguments were presented, and didn't handle the case where fewer than
two arguments were provided. This change requires precisely two
arguments and returns an error otherwise.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-01-24 15:11:21 -07:00
jason yang
d262ec10ef Add container rename support
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2024-01-24 15:11:16 -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
67e526d726 added test and reafctorred kernel.Build
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-01-17 23:23:15 -07:00
Jonathon Anderson
1c87ce1367 Remove automatic setting of default container
Since grub support no longer depends on a default container, no longer
automatically set default container on import.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-01-17 18:02:04 -07: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
2fe98e5f55 default profile needs to have a container
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-01-17 18:02:04 -07:00
jason yang
231987ecfc fix a bug when replacing existing containers
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-12-12 17:06:28 -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
214848c75e Add IPMI escape char functionality 2023-12-04 15:42:01 +01:00
Jonathon Anderson
c8604bc200 Remove testenv.WriteFileAbs
Writing absolute file names in testenv breaks safety that files in the
test environment are written to the designated temporary path. Adjusted
the relevant tests to use testenv.WriteFile.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2023-11-25 23:54:44 -07:00
Christian Goll
5d25b3a4a6 added explicit tests for overlay commands
Signed-off-by: Christian Goll <cgoll@suse.com>
2023-11-25 01:54:02 -07:00
Jonathon Anderson
4f41a569dd Replace development with main
The development branch has been replaced with the main branch in GitHub.
Replaces references to development in docs, commands, configuration, and
workflows.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2023-11-25 00:27:52 -07: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
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
a7056e2bb8 mtu can be set via command line
added also a test for this

Signed-off-by: Christian Goll <cgoll@suse.com>
2023-10-14 02:09:06 -06:00
Jonathon Anderson
6c344cd5b0 Refactor ww4test to testenv
- Remove global state
- Remove redundant data
- Remove unused functionality (e.g., file permissions)
- Separate directory creation from file writing
- Additional helper functions for file reading and cleanup

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Signed-off-by: Christian Goll <cgoll@suse.com>
2023-10-13 14:35:28 +02:00
Christian Goll
b5979e41d2 added general testing framework
framework creates all the necessary configuration file for warewulf
under a temporary directory. Individual warewulf.conf and nodes.conf
can be provided.

Signed-off-by: Christian Goll <cgoll@suse.com>
2023-10-11 12:07:28 +02:00
Christian Goll
ff7608251a advanced command line completion for wwctl overlay
Signed-off-by: Christian Goll <cgoll@suse.com>
2023-09-13 12:03:43 +02:00
Christian Goll
3acac6077a Merge pull request #897 from mslacken/EphermalMount
Epehermal container mounts on same fs as chroot
2023-09-13 11:24:06 +02:00
Jonathon Anderson
7e4e2a3f71 Fix and update initial overlay template
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2023-08-31 17:44:46 -06:00
Jonathon Anderson
fb49b6082e Update overlay edit with tempfile and mtime
The recent `overlay edit` command reimplementation included some
incorrect ordering that led to spurious error messages for files that
did not yet exist. This reimplementation reorders operations to avoid
such error messages and clarifies the implementation by editing in a
temporary file and using mtime to discern whether an edit has occurred.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2023-08-31 15:55:18 -06:00
Arnaud LECOMTE
aeb7793fba Switching cp to copy 2023-09-05 14:37:29 +02:00
Arnaud Lecomte
f2392f6e37 Updating documentation & API endpoint for container copy 2023-08-28 08:39:15 +02:00
Arnaud Lecomte
b56f024e6f Core of image's duplication feature 2023-08-25 13:54:39 +02:00
Christian Goll
7ac2970d83 fix warewulf.conf location for wwclient
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-08-23 14:18:43 -06: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
d3650244f9 Epehermal container mounts on same fs as chroot
Previously ephemeral container mounts were performed in /tmp. Now these
mounts are overlayed on the same fs as is used for chroots.

Signed-off-by: Christian Goll <cgoll@suse.com>
2023-08-17 11:17:17 +02:00
Jonathon Anderson
abd3e21aa0 Fix a typo in container delete confirmation prompt
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2023-08-08 19:31:02 -06:00
John Hanks
6a53b9aa19 Replace deprecated io.ioutil functions with new os versions. 2023-07-25 18:54:06 -05: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
Jonathon Anderson
3bfd22f65a Merge branch 'development' into issue/608 2023-05-16 01:11:32 -06:00
jason yang
869d3d7c76 squash commits
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-05-15 10:31:07 +00:00
jason yang
956e1b3569 squah commits
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-05-15 10:27:52 +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
62018eedf0 Fix a failing unit test after a rebase
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:05:24 -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
8321193645 Refactor and document config/datastructure
Also adjusted case for initialisms (e.g., DHCP, TFTP, NFS).

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
cfdf179e16 Remove SetDynamicDefaults from Parse
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