Commit Graph

93 Commits

Author SHA1 Message Date
Christian Goll
d584c14403 Merge pull request #1564 from anderbubble/issues/1447
Use a sentinel file to determine container readonly state
2024-12-02 09:03:02 +01:00
Jonathon Anderson
07f6402520 Use a sentinel file to determine container readonly state. #1447
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-29 10:37:52 -07:00
Jonathon Anderson
5834b82f93 Format errors in logs as strings
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-23 22:47:48 -07:00
Jonathon Anderson
e80c639b11 Convert config to *bool
Supports leaving booleans unspecified in YAML.

Boolean methods allow the templates to continue using previous names for
boolean values.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:09:48 -07:00
Christian Goll
0dd0317740 replaced errors.Wrap with fmt.Errorf
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-11-07 22:57:29 -07:00
Jonathon Anderson
a0c58e4183 Simplify passing of arguments through wwctl container exec
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-06 15:43:14 -07: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
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
d24a92965f Merge pull request #1406 from anderbubble/1389-rundir-help-text
Additional help test when container.RunDir already exists
2024-09-25 11:10:22 +02:00
xu yang
94e203dd2e return non-zero exit code on container sub-commands
Signed-off-by: xu yang <xyang@ciq.com>
2024-09-25 08:50:50 +00:00
Jonathon Anderson
836b791d74 Additional help test when container.RunDir already exists
- Closes #1389

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-09-19 11:40:10 -06:00
Jonathon Anderson
96119484d8 Move syncuser pass from shell to exec
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-09-17 21:26:32 -06:00
xu yang
0b3eace403 Add syncuser to wwctl container shell and switch to mtime
Signed-off-by: xu yang <xyang@ciq.com>
2024-09-17 21:26:30 -06:00
Jonathon Anderson
5860334a89 Improve error handling during container file copy removal
Based on feedback at #1365

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-09-09 11:09:10 +02:00
Jonathon Anderson
9e91b1c19a Rename :cow to :copy
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-09-09 11:09:10 +02:00
Jonathon Anderson
3a36016707 Refactor of new copy-on-write feature
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-09-09 11:09:09 +02:00
Jonathon Anderson
173546348f Edited documentation for new copy-on-write feature
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-09-09 11:09:09 +02:00
Christian Goll
dc263425e2 Added cow option to bind
The option cow can now be set for files which are then
mounted during exec, but copied into the image and removed
if not modified.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-09-09 11:09:04 +02:00
Jonathon Anderson
6028a6eb58 Minor adjustments to exitEval and msgStr
For grammar clarity, and consistency.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-08-02 13:29:59 -06:00
Christian Goll
9d2853ad64 Show pending container build status during container exec, shell
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-08-02 11:43:05 -06:00
Christian Goll
cfacb4d520 mount /sys and /run during container exec
Also unify mounting of sys, run, proc, and dev as occuring within the
chroot and without bind mounts from the host.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-07-04 07:54:55 +02:00
xu yang
c28404ea6c Add test cases for container exec
Signed-off-by: xu yang <xyang@ciq.com>
2024-06-11 23:59:36 -06:00
Jonathon Anderson
5bb13c8baf Fix regression in container exec argument parsing
- Fixes #1250

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-06-11 23:57:58 -06:00
Jonathon Anderson
2c5e079d33 Refactor overlayDir to container.RunDir()
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-06-07 14:18:19 -06:00
Christian Goll
0eba837950 use warewulf.conf from parent on child
The directories for the overlays needed for the bind
mount are now created under conf.Paths.WWChrootdir/$CONTAINERNAME
with the pattern $CONTAINERNAME-run-xxxxxx. This pattern can be
used as lock, so that there can't be congruent shell/exec calls
to the same container.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-06-06 16:46:10 -04:00
Christian Goll
dc6db3d565 using the right overlay directory and remove it
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-06-06 16:46:10 -04:00
Jonathon Anderson
6b8ca378d8 Refactor syncuser to reduce walking the container fs
- Closes #1209

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-06-03 19:18:25 -06: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
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
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
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
70292276e2 Rename BaseConf.New to BaseConf.Get
Since BaseConf.New could return a cached BaseConf, rather than always
constructing a new struct, I've renamed it to Get to more accurately
reflect its use. A new New() method is called by Get and always
initializes a new struct.

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
Christian Goll
78978ad233 added warewulfconf as command line parameter
the environment variable WAREWULFCONF is also recognized

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-03 11:18:49 +01:00
Christian Goll
3eaeac46d2 use canonical os.TempDir 2023-02-03 15:39:00 +01:00
Christian Goll
80687f9475 removed mounts.conf and check of env shell 2023-02-03 15:15:41 +01:00
Christian Goll
05237935eb node option also for shell and respect env $SHELL 2023-01-31 18:05:18 +01:00
Christian Goll
317cd5d4e0 add option for node rendering 2023-01-31 17:45:09 +01:00
Christian Goll
157c3cd923 getting defaults mounts from warewulf.conf 2023-01-31 16:04:08 +01:00
Christian Goll
d82314460f added support for mounts.conf for container exec 2023-01-31 16:04:07 +01:00
Christian Goll
71a3867bbe create temporary dir for overlayfs not in __child 2023-01-31 16:04:07 +01:00
Christian Goll
6d560ac02a create overlayfs for ephermal mount points 2023-01-31 16:04:07 +01:00
Christian Goll
a4202df508 create overlay of missing mount points 2023-01-31 16:04:07 +01:00
Christian Goll
d30d523866 respect read only rootfs for containers 2023-01-31 16:04:07 +01:00
Christian Goll
7ade65c73f cleaned up container exec __child 2023-01-31 16:04:07 +01:00
Christian Goll
5249931ab0 do not call container exec for shell call 2023-01-31 16:04:07 +01:00
Christian Goll
55f61a7c18 pass log level to container exec 2023-01-31 16:03:57 +01: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
Jonathon Anderson
22910958b5 Replace all instances of wwlog.Printf
wwlog provides named loggers for each level, which requires
less code and is clearer than wwlog.Printf. The code has
included a mix of both, but this commit consolidates existing
code on the per-level functions.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2022-09-11 08:00:23 -06:00