Commit Graph

96 Commits

Author SHA1 Message Date
Jonathon Anderson
9884aad504 Consolidated createOverlayFile and updateOverlayFile to addOverlayFile
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:48 -06:00
jason yang
62d1aa654d Support for creating and updating overlay file in wwapi
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2025-07-28 18:18:48 -06:00
Jonathon Anderson
c7bda5e655 Add tests for overlay import --overwrite
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-03-21 23:42:30 -06:00
Jonathon Anderson
ec453863d5 Resolve "problems" identified by vscode
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-06 22:11:17 -07:00
Jonathon Anderson
73a8ef8e0e Refactor wwctl <node|profile> edit and fix bugs
`wwctl node edit` appears to not be working properly since MergeNode. This
refactor, partly towards #918, resolves the issues with `node edit` and updates
`profile edit` to match.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-19 13:02:18 -07:00
Jonathon Anderson
a18913924d Benchmarking for wwctl overlay build
- Benchmarks overlay build in an environment with 1000 nodes
- Updates testenv to support both benchmarks and tests

To execute:

```
go test github.com/warewulf/warewulf/internal/app/wwctl/overlay/build -bench Benchmark_Overlay_Build
```

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-25 12:34:23 -07:00
Jonathon Anderson
53e5805fbe Remove os.Umask from overlay.BuildOverlayIndir
Adds tests to ensure that the overlay image contains the correct permissions.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-25 08:48:14 -07:00
Jonathon Anderson
1affdc1883 Remove Chdir from util.BuildFsImage
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-25 08:48:14 -07:00
Jonathon Anderson
9dd1ca0d53 Removed Chdir from util.FindFilterFiles
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-25 08:48:14 -07:00
Jonathon Anderson
b0164c36b9 Remove Chdir from util.FindFiles
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-25 08:48:14 -07:00
Jonathon Anderson
170f055c20 Log cpio errors more prominently
Previously, cpio output would only be shown as a debug message. Now it is shown
as an error message if cpio returns an error.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-25 00:34:38 -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
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
28a7b9fe84 removed NodeInfo and using NodeConf instead
This is a significant change in the undelying data model!

nodeDb, err := node.New()

will result in a structure which contains the on disk
values. Only

nodeDb.FindAllNodes() or nodeDb.GetNode(id) will give
the nodes with its merged in profiles.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-17 13:35:42 -04:00
Jonathon Anderson
75d9ac5fb2 Capture "broken" symlinks during container build
- Fixes #1267

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-07-01 17:12:25 -06:00
Tobias Ribizel
faacb1cc4e Add test for FindFilterFiles
Signed-off-by: Tobias Ribizel <mail@ribizel.de>
2024-06-17 00:01:14 +02:00
Tobias Ribizel
a6a0538f42 Fix FindFilterFiles
There are two bugs in the handling of exclusion patterns:
- The paths being checked against patterns are relative,
  so leading / need to be stripped
- filepath.Match only does a string comparison,
  and the paths we traverse don't include trailing /

Signed-off-by: Tobias Ribizel <mail@ribizel.de>
2024-06-17 00:01:04 +02: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
bd54993e16 refactored FindFiles
Previous version relied on fspath.Math which didn't match
nested sub directories.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-01-17 23:23:15 -07:00
Christian Goll
36686d4455 fixed kmod creation
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-01-17 23:23:15 -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
Christian Goll
d23e67970d Support importing container with symlinked shell
Fixes #797

Signed-off-by: Christian Goll <cgoll@suse.com>
2023-12-09 01:59:05 -07:00
Christian Goll
d30d523866 respect read only rootfs for containers 2023-01-31 16:04:07 +01:00
Jeffrey Frey
17d6448180 Fix unhandled return value from Wait()
Discard return error from proc.Wait() to pass lint tests
2022-11-30 16:08:58 -05:00
Jeffrey Frey
8c6f85a0a9 Update util.go 2022-11-29 15:13:00 -05:00
Jeffrey Frey
fd1f197468 Update util.go 2022-11-29 15:09:14 -05:00
Jeffrey Frey
52b932081c Scoping issue with err
Use of := inside conditional body overrode scope of return value `err`
2022-11-29 14:40:06 -05:00
Jeffrey Frey
e9d7432e79 Fixup spacing
Tabs, not spaces.
2022-11-29 14:10:16 -05:00
Jeffrey Frey
9c3cc59d85 Missing --keep option, older versions of gzip
Older versions of the `gzip` utility do not understand the `--keep` flag.  If `gzip` is used and initially exits in error with the text "unrecognized option" produced on stderr, use the write-to-stdout behavior for `gzip` and open and attach the desired output file to that command's stdout.
2022-11-29 14:03:58 -05:00
Christian Goll
4fe584547b Merge branch 'development' into wwlog-newlines 2022-10-13 14:46:03 +02:00
Christian Goll
fab7e09aeb Merge branch 'development' into container-info2 2022-10-13 10:53:49 +02:00
Christian Goll
396f3238c1 added size of containers 2022-10-13 10:35:17 +02:00
Christian Goll
72f9fdacbf Merge pull request #533 from anderbubble/container-build-exclude
Fix of container build include/exclude handling
2022-10-12 21:24:05 +02:00
wesley800
6954eefe5e properly truncate dest file in util.CopyFile 2022-09-19 21:11:51 +08: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
ff54fbc8d7 Simplify util.FindFilterFiles
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2022-09-11 19:25:40 -06:00
Jonathon Anderson
cac614a4b7 Correct handling of exclude patterns
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2022-09-11 19:25:40 -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
Carter Dodd
7eae65e13f Add process max reserve 2022-06-06 17:43:33 -05:00
Carter Dodd
3242d2998e fixups 2022-06-05 17:37:23 -05:00
Carter Dodd
30ba916703 Move overlay build logic to util, add limit to spawned processes 2022-06-05 17:28:14 -05:00
Carter Dodd
f14f339576 fixups 2022-06-04 11:42:16 -05:00
Carter Dodd
fc8d3863d8 use wwctl to re-build provision overlays, update to pass overlaynames 2022-06-04 11:14:48 -05:00
Carter Dodd
42cc91162d Fix error handling in goroutine 2022-05-13 23:03:04 -05:00
Carter Dodd
a27be52e3f Fix unhandled errors 2022-05-13 22:33:29 -05:00
Carter Dodd
a36467b2a8 Merge upstream 2022-05-13 19:42:18 -05:00
Carter Dodd
379faad51d Refactor of server, logging, building of images, template updates
* Combine provision response handling, add hwaddr and interface to dhcp
* Simplify stage cases, add backward compatible uri parse
* Move control of image compression to client
* Fix kernel search path for ubuntu, buffer template generation
* Implement cpio and gz as functions, add log named functions
* Generalize fs image creation routine
* Combine daemonLogf to generalized wwlog
* Fix template newline insertion, update dhcp and hosts tmpl
* Update IPXE template to handle non-compressed files
* Update DHCP template to set network interfaces and server IP assignment
* Update DHCP/hosts templates to choose a host-name self-consistently
2022-05-13 16:52:59 -05:00