- Remove global state
- Remove redundant data
- Remove unused functionality (e.g., file permissions)
- Separate directory creation from file writing
- Additional helper functions for file reading and cleanup
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Signed-off-by: Christian Goll <cgoll@suse.com>
framework creates all the necessary configuration file for warewulf
under a temporary directory. Individual warewulf.conf and nodes.conf
can be provided.
Signed-off-by: Christian Goll <cgoll@suse.com>
The vendor target can't reliably determine when it needs to run, so mark
it phony. At the same time, update go.mod.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Rather than implementing OFFLINE_BUILD individually within each relevant
target, define all such target dependencies once.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Primary network devices are now identified by a per-node attribute,
rather than a per-netdev boolean. While the legacy data can still be
parsed, the argument for setting the per-netdev boolean at the
command-line is no longer available.
Correct behavior is tested.
Signed-off-by: Christian Goll <cgoll@suse.com>
The recent PR #883 replaced the standard overlay naming convention with
static names for each of the runtime and wwinit/system contexts; but the
method by which it left the "legacy" naming convention in place led to a
bug where warewulfd was still attempting to serve overlays with the
previous naming convention, though this name wasn't being built.
This PR refactors contextual overlay image naming to be, I think, a more
typical golang pattern, and updates affected code to match.
This PR also included tests for all functions modified by this change.
Fixes#896
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
`unzip` preserves the mtime from the zipfile by default. Touching the
file during `make` ensures that `make` can track when the file was
fetched.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
The introduction of a new ARCH variable was unnecessary, as ARCH already
exists. That said, the .zip provided for PROTOC isn't a natural fit
here either, as upsream uses `aarch_64` rather than `aarch64`.
In stead, I've used `notdir` to get the filename from the
already-defined `PROTOC_URL`.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This allows `make` and `make all` to avoid unnecessary repeat builds,
and saves automatic generation of man pages for `install`.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Using a `config` variable in target dependencies allows the underlying
targets to be referenced properly, rather than passing through a "phony"
`config` target. This allows dependent targets to not have to re-run if
their dependencies have remained static, as expected.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
The `all` target should be the default for make; but placing it after
the `include` directives allowed the targets within the included files
to take precedence.
Moving `all` before the `include` directives restores it to default
status.
I also used this opportunity to restore the `build` target as the
defining target, and then just set up a dependency between `all` and
`build`.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>