Commit Graph

51 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Christian Goll
7e42286610 fixed linting 2022-04-07 11:35:34 +02:00
Christian Goll
5fb10130f3 check for modifcation of passwd/group after exec 2022-04-06 21:44:00 +02:00
Gregory Kurtzer
b60cacbd0f Revert "removed unused container child"
This reverts commit 30bc445a89.
2022-03-02 19:53:10 -08:00
Christian Goll
30bc445a89 removed unused container child 2022-03-02 15:39:47 +01:00
Gregory Kurtzer
2260be9f8f Working implemnetation of #271 2022-02-13 04:22:12 +00:00
Christian Goll
df127b179d q 2022-02-03 09:59:24 +01:00
Christian Goll
ad87ba7647 execute './.ww4/runExit` on exeit of container exec 2022-01-31 17:20:24 +01:00
jcsiadal
0b93d6c277 Update help
Signed-off-by: jcsiadal <jeremy.c.siadal@intel.com>
2021-11-08 11:36:21 -08:00
Gregory M. Kurtzer
4b5e3fd6eb Merge pull request #117 from WestleyK/remove_commented_code
Remove commented test code
2021-09-08 16:12:09 -07:00
WestleyR
cab2d4a316 Remove commented test code
Seems to be extra test code from
09a83ff904.
2021-09-08 14:12:20 -07:00
Gregory Kurtzer
84c0c72219 MS_REC added to MS_PRIVATE mount on root 2021-09-08 11:52:22 -07:00
Gregory Kurtzer
09a83ff904 Container exec fixups 2021-09-08 11:40:14 -07:00
WestleyR
4edc16953e Fix linting issues 2021-09-07 20:48:51 -07:00
Gregory Kurtzer
4c8edc16fe Changed API name to valid path 2021-09-02 15:34:19 -07:00
Gregory Kurtzer
ed64386b8b remove debug print 2021-09-01 21:20:50 -07:00
Gregory Kurtzer
caf9f4b80f Have more intelligence on splitting bind paths 2021-09-01 21:13:46 -07:00
Gregory Kurtzer
198791fb10 add default and sane path to container exec 2021-09-01 19:26:38 -07:00
Gregory Kurtzer
fc7182d7bd Don't bind resolv.conf, copy on import 2021-09-01 19:23:13 -07:00
Gregory Kurtzer
371767daed Merge branch 'main' of github.com:hpcng/warewulf into cleanups 2021-08-22 19:10:09 -07:00
Gregory Kurtzer
a82e1b0ea5 Fixed formatting across entire project 2021-08-21 08:04:47 -07:00
Gregory Kurtzer
cf45e5b8f6 Removing another debug Println() 2021-08-20 18:21:26 -07:00
Gregory Kurtzer
7826f69656 Support binds in container exec command
This addresses issue #88.
2021-08-20 14:16:16 -07: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
90157e340a Set the HISTFILE to /dev/null so we don't rebuild containers on every exec 2020-12-19 21:06:04 -08:00
Gregory Kurtzer
c53c97dbcf Created template for server process subcommands 2020-12-10 20:57:32 -08:00
Gregory Kurtzer
5c995f9d0f Added Init to datastructure, fixups to container interface, and --setdefault to kernel and container build 2020-12-06 22:29:25 -08:00
Gregory Kurtzer
9de9778648 Add bind points for /dev/ and /etc/resolv.conf into the container when exec'ing 2020-12-06 10:00:04 -08:00
Gregory Kurtzer
bbfe1023e9 Add file for non-Linux placeholder. 2020-12-06 09:39:48 -08:00