For linux arm64 and amd64, as per #586.
I moved the builder image into the same dockerfile, and bumped the Go
version on it. It didn't seem like the builder dockerfile worked with
the latest code anyway (the go modules require go 1.15 and higher).
This requires a recent enough docker install with buildx, as well as
an arm64 builder.
BASEIMAGE is changed to not specify an arch, so that the image will
build on its native arch in buildx.
Example image is on docker hub as:
kelvie/node-problem-detector:v0.8.10-5-gb0fa610
This plugin requires libsystemd to compile, which is only available on
Linux. This uses `go env` to determine if the current build platform can
support this or not, and if not, disables the building of the plugin to
allow compilation on Windows and macOS platforms.
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Journald is not available on mac. To allow building the rest of the
project while working on a mac, use the same flag as the Windows build
to skip inclusion of journald.
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This has several benefits. For example, now I can develop and build linux binaries of the NPD on my mac. Also other devs don't need to make sure they have the systemd headers installed.
1. Why is this change necessary ?
Solves kubernetes/node-problem-detector#163
2. How does this change address the issue ?
Unit testing for node-problem-detector/cmd/options is yet to be
done and the corresponding package path needs to be included in makefile
test
3. How to verify this change ?
make test command should run the test TestSetNodeNameOrDie with admin
privileges.
Signed-off-by: gkGaneshR <gkganesh126@gmail.com>
This image is based on Debian Stretch (9) which has a recent version of
systemd libraries that includes all necessary compression algorithms.
I propose using that image unconditionally (instead of Alpine when
journald is disabled) since the image size with debian-base is not that
much of a concern anymore.