metropolis/node: show build commit on startup
Previously it was not possible to identify the running version,
with this change the build commit and tree state gets stamped into the binary
and printed on boot.
Change-Id: I3916e3d40dc87f28a58eb74c6450218550fb3214
Reviewed-on: https://review.monogon.dev/c/monogon/+/1978
Tested-by: Jenkins CI
Reviewed-by: Serge Bazanski <serge@monogon.tech>
diff --git a/metropolis/node/BUILD.bazel b/metropolis/node/BUILD.bazel
index 578664b..a62d8aa 100644
--- a/metropolis/node/BUILD.bazel
+++ b/metropolis/node/BUILD.bazel
@@ -12,12 +12,18 @@
"net_ips.go",
"net_protocols.go",
"ports.go",
+ "version.go",
],
importpath = "source.monogon.dev/metropolis/node",
visibility = [
"//metropolis:__subpackages__",
"@io_k8s_kubernetes//pkg/registry:__subpackages__",
],
+ x_defs = {
+ "BuildCommit": "{STABLE_METROPOLIS_gitCommit}",
+ "BuildTreeState": "{STABLE_METROPOLIS_gitTreeState}",
+ "BuildVersion": "{STABLE_METROPOLIS_version}",
+ },
deps = ["@com_github_vishvananda_netlink//:netlink"],
)