Commit Graph

98 Commits

Author SHA1 Message Date
Jonathon Anderson
c18bcfe3bd Support importing containers from directories containing a socket
- Fixes #892

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-09 11:19:48 -07:00
Jonathon Anderson
8f21d54243 Refactor kernel support
- Remove kernel imports and kmods images
- Repurpose KernelOverride as container path
- Support Kernel.Version as version prefix for kernel selection
- Compare initramfs by version

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-09 10:02:22 +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
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
fbd5ca9895 Recommended refactors
- make sure spec sets new cache dir
- move clean out of api
- capture warewulfconf.Paths.Cachedir+"/warewulf" in once place
- split Clean() into multiple functions
- remove WriteFileAbs

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-10-28 15:20:41 -06:00
Christian Goll
511938ac5c add Cachedir and point OCIBlobCache to it
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-28 15:20:41 -06:00
Jonathon Anderson
b331fd12af Remove dead code
Verified with

```
deadcode -test ./...
```

Followed-up with a lint check.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-10-18 15:09:01 -06:00
Christian Goll
9a28b2d7fb copy.DirCopy is internal and needs Init
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-09-21 22:12:57 -06:00
xu yang
1f492dfed5 Add flag --build to wwctl container copy, default false
Signed-off-by: xu yang <xyang@ciq.com>
2024-09-20 17:31:17 -06:00
Jonathon Anderson
9e91b1c19a Rename :cow to :copy
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-09-09 11:09:10 +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
d05414436a Additional guidance when syncuser conflicts
- Closes #1359

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-09-06 14:03:15 -06:00
Jonathon Anderson
0b765d242a Extend new syncuser handling for +/- entries
Since these lines are being omitted in the final sync'd passwd/group
file, a new message indicates that the line is being skipped; but it is
no longer denoted as a parse error.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-07-04 23:54:46 -06:00
Christian Goll
ba3c24e1c3 ignore +:: style lines in passwd/group
The lines +::::: or +::: are used in passwd/group as
placeholer for users added form the network via ldap/nis/sssd.
These lines should not trigger a warning.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-07-04 23:54:46 -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
xu yang
a322061fe9 Add initramfs stage to warewulfd
The initramfs stage supports serving an initramfs image from within the
container image, typically generated by dracut.

Signed-off-by: xu yang <xyang@ciq.com>
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-06-06 03:14:21 -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
03aae1a1d9 Fix parsing of /etc/group during syncuser
- Closes #1202

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-04-30 23:27:06 -06:00
Jonathon Anderson
addde549ff Only walk the filesystem during syncuser if writing
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-04-25 14:42:56 -06:00
Christian Goll
2ba9efa57c created kernel.FindKernel reduces code complexity
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-04-19 16:12:22 -06:00
Christian Goll
b192e3b5d5 fixed ShimFind for aarch64
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-04-19 16:12:21 -06:00
Christian Goll
16f5b7408e added tests for BootLoaderFindPath for x86/aarch64
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-04-19 16:10:57 -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
725176cfed cleanup code after review
Signed-off-by: Christian Goll <cgoll@suse.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
724441dc79 added test for shim and efi send
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-01-17 18:02:04 -07:00
Christian Goll
0c9bf78cd0 using ProvisionSend instean of GrubSend
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-01-17 18:02:04 -07:00
Christian Goll
60dc8f6251 enable grub boot for all nodes
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
a36cb23319 added shim/grub find to provision process
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-01-17 18:02:04 -07:00
Jonathon Anderson
9c698d7a13 Merge pull request #932 from mslacken/WarnNotErr
warn and don't show scary error on syncuids
2023-12-09 02:19:03 -07:00
Christian Goll
77c33c777e Warn and don't show a scary error in syncuser
Signed-off-by: Christian Goll <cgoll@suse.com>
2023-12-09 02:12:46 -07:00
Christian Goll
7de3c1c5cd Don't panic on malformed passwd
Fixes #527

Signed-off-by: Christian Goll <cgoll@suse.com>
2023-12-09 02:05:53 -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
Arnaud Lecomte
b56f024e6f Core of image's duplication feature 2023-08-25 13:54:39 +02:00
Jonathon Anderson
7b2f278f94 Refactor and fix bugs in syncuids
Closes #840

* SyncUids can now return applicable errors even during showOnly, so
  updated ContainerImport to ignore errors during showOnly.
* Fixed handling of file gids during SyncUids

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2023-08-08 11:25:09 -06:00
Jonathon Anderson
a10fdb3808 Remove config.DataStore()
Comments in the code were already disparaging of config.DataStore(), but
implied that its presence made other code more readable. It was only
used in two places and, imo, how I've refactored it is more explicit and
clear than it was.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06: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
ce43dfa0b7 removed getters as configs must exportable
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-06 10:20:00 +01:00
Christian Goll
377702a179 make the configuration to be based in warewulf.conf
defaults will be se by the Makefile

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-03 16:02:41 +01:00
Christian Goll
063c05602d Merge pull request #665 from mslacken/ContainerMnt
Container mnt
2023-02-24 15:13:12 +01:00
Christian Goll
7e64e995cb Merge pull request #653 from anderbubble/650-syncuser-error-message
Refactor some variables in syncuser and correct error message
2023-02-03 12:27:15 +01:00
Jonathon Anderson
e8e9c4f3bd Merge branch 'development' into lint-update 2023-02-02 14:38:33 -07: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
Jonathon Anderson
7e94c265f0 Refactor some variables in syncuser and correct error message
- Rename some internal variables to make the function easier to follow
- Refactor some code to make it simpler
- Remove some commented-out code
- Fix an error message

Closes #650

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-01-24 22:06:19 -06:00
Jonathon Anderson
42f4f1db34 Simpler symlink handling in KernelFind
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-01-17 23:43:22 -07:00
Christian
750358646d resolve symlink for kernel version 2023-01-16 14:34:16 +01:00