m: {cli,installer}: runfiles through datafile.MustGet
This implements datafile, a small library to more ergonomically resolve
Bazel runfiles:
1. It also works in cases where a tool doesn't run through `bazel run`.
2. It provides a MustGet wrapper which returns already read bytes and
removes some boilerplate at the callsite.
3. It allows us to extend the library in the future to prepare special
'self-contained' builds of some binaries, for example to bundle the
installer kernel in metroctl.
We then use this library to simplify the installer and installer tests.
In the installer, we technically remove the ability to specify arbitrary
kernels/bundles on the command line, but is this functionality actually
useful?
Change-Id: I46155b9951729c810e0d36930b470edfdfd82943
Reviewed-on: https://review.monogon.dev/c/monogon/+/484
Reviewed-by: Mateusz Zalega <mateusz@monogon.tech>
diff --git a/metropolis/cli/metroctl/BUILD.bazel b/metropolis/cli/metroctl/BUILD.bazel
index 6a311c8..f9b8b51 100644
--- a/metropolis/cli/metroctl/BUILD.bazel
+++ b/metropolis/cli/metroctl/BUILD.bazel
@@ -16,6 +16,7 @@
deps = [
"//metropolis/cli/metroctl/core:go_default_library",
"//metropolis/cli/pkg/context:go_default_library",
+ "//metropolis/cli/pkg/datafile:go_default_library",
"//metropolis/node:go_default_library",
"//metropolis/node/core/rpc:go_default_library",
"//metropolis/proto/api:go_default_library",