Commit Graph

101 Commits

Author SHA1 Message Date
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
ff7608251a advanced command line completion for wwctl overlay
Signed-off-by: Christian Goll <cgoll@suse.com>
2023-09-13 12:03:43 +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
Christian Goll
a7df560a30 Add json output for ignition
Signed-off-by: Christian Goll <cgoll@suse.com>
2023-08-21 16:19:13 -06:00
John Hanks
6a53b9aa19 Replace deprecated io.ioutil functions with new os versions. 2023-07-25 18:54:06 -05:00
jason yang
869d3d7c76 squash commits
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-05-15 10:31:07 +00: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
2c9a241643 Merge pull request #683 from hpcng/overlayEdit
make output less scary for new files
2023-02-24 15:15:46 +01:00
Christian Goll
e64b370e73 Merge pull request #673 from mslacken/Fix523
build host overlay only if requested
2023-02-24 15:11:31 +01:00
Jonathon Anderson
cf68113c28 Merge pull request #667 from anderbubble/485-fix-overlay-ls-header
Correct header for overlay list -al
2023-02-18 23:23:13 -07:00
Christian Goll
77352fe36f removed unused flag for import 2023-02-13 12:27:47 +01:00
Christian Goll
5ed711490d remove list files option from edit 2023-02-13 11:25:35 +01:00
Christian Goll
d91f552473 make output less scary for new files 2023-02-13 11:11:19 +01:00
Jonathon Anderson
e8e9c4f3bd Merge branch 'development' into lint-update 2023-02-02 14:38:33 -07:00
Christian Goll
e4eabd036e build host overlay only if requested 2023-02-01 11:35:00 +01:00
Jonathon Anderson
db35d5a5e7 Correct header for overlay list -al
Fixes #485

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-01-31 11:59:40 -07:00
Jonathon Anderson
78b857a3e4 Whitespace cleanup
Removes trailing whitespace from all source files.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2022-12-08 18:59:56 -07:00
Christian Goll
5413eb611d removed stray debug line 2022-10-27 12:08:32 +02:00
Christian Goll
721a52239f opening file with twi seperate descriptors 2022-10-27 12:03:10 +02:00
Christian Goll
21f7a1f8c3 fix linting 2022-10-27 11:32:30 +02:00
mslacken
12efa0cc68 check if new template file was modified 2022-10-14 18:18:58 +02:00
mslacken
ab0ee87629 updated linter and fixed deprecated stuff 2022-10-14 17:40:16 +02: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
fd2fa9c027 Fix argument handling for overlay show rendering
Error logging for overlay show rendering incorrectly checked
the overlay name rather than the path to the file. It also
used wwlog (which goes to stderr) to output the render. This
commit replaces explicit args[] references with their named
equivalents from earlier in the function, correcting those
references along the way, and outputs the final render with
fmt.Print.
2022-09-16 22:39:51 +00: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
Jonathon Anderson
e2b5350834 Fix handling of uid and gid arguments during chown
It appears that the intended behavior of overlay chown was changed
in 00d8d42e9, but the argument handling was not updated to reflect
the removal of overlayKind. This led to a crash when only the
uid was specified, and a processing of the gid as the uid
otherwise.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2022-09-11 00:38:05 -06:00
Jonathon Anderson
4bda8cd29e Don't change unspecified gid to 0 during chown
Specifying 0 for gid as a default during chown causes the
gid to be changed to 0 when left unspecified. Changing the
default value to -1 causes the gid to be left unmodified
when unspecified, which is a less surprising behavior.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2022-09-10 14:51:56 -06:00
Christian Goll
d976e7fc31 Merge pull request #467 from mslacken/single-Overlay
enable overlay rendering
2022-06-24 09:50:14 +02:00
Christian Goll
95e03b3df4 get arguments for show --render right 2022-06-08 15:56:10 +02:00
Christian Goll
69c058f106 added bash completion for overlay commands 2022-06-08 15:49:55 +02:00
Christian Goll
53667157c5 parse not own command but show --render 2022-06-08 15:36:20 +02:00
Christian Goll
2f4757600d added quiet option 2022-06-08 15:10:47 +02:00
Christian Goll
312596276e Add source for parse 2022-06-08 15:10:47 +02:00
Christian Goll
98e085c6f2 Trim 'ww' suffix on output 2022-06-08 15:10:46 +02:00
Christian Goll
9e5b2d1aa3 added the wwctl overlay parse command
The `wwctl overlay parse -n NODE FILE` will interpret the given overlay file and print it stdout, via wwlog.PRINTF.
The overlay code had to be refactored for this, but hopefully this makes the code a bit more readable. Also the tstruct has not its own initilization code.
2022-06-08 15:10:46 +02:00
Carter Dodd
97c24e22f7 fixup for backward compatible case 2022-06-04 12:13:13 -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
mslacken
01f2f4fc99 filter out nodes acordiing to their overlays 2022-05-12 21:23:37 +02:00
Christian Goll
bfec010e5d only build assigned overlays
If a overlay should be build, check if the overlay is assigned to
a node, and return error if otherwise.
2022-04-26 10:24:52 +02:00
Christian Goll
2d2fb13423 warewulf.conf option disable host overlays 2022-03-30 17:23:38 +02:00
Christian Goll
dfd39ae663 shell completion for wwctl voerlay build 2022-03-17 12:42:34 +01:00
Christian Goll
0d62a26368 wwctl overlay buld fixes 2022-03-16 17:28:04 +01:00
Christian Goll
9dbf371174 overlay build allow output to given dir 2022-03-16 12:23:33 +01:00