m/n/c/{cluster,curator}: move NodeCredentials to cluster
This keeps the NodeCredentials/NodeCertificate logic types near their
consumer, the cluster bootstrap code. It also rewrites these structures
to be centered around the x509 data itself.
This is a followup to https://review.monogon.dev/c/monogon/+/186 .
Attempting to introduce it into that change was too complex due to the
surrounding cluster/curator refactoring.
We also take this opportunity to write some simple tests for the
credential validation logic.
Change-Id: Iead3cfdd5778274508d79799f4750f5fdf9385bc
Reviewed-on: https://review.monogon.dev/c/monogon/+/197
Reviewed-by: Lorenz Brun <lorenz@nexantic.com>
diff --git a/metropolis/node/core/cluster/BUILD.bazel b/metropolis/node/core/cluster/BUILD.bazel
index fcf8aae..322a337 100644
--- a/metropolis/node/core/cluster/BUILD.bazel
+++ b/metropolis/node/core/cluster/BUILD.bazel
@@ -1,10 +1,11 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = [
"cluster.go",
"cluster_bootstrap.go",
+ "node.go",
"status.go",
"watcher.go",
],
@@ -25,3 +26,10 @@
"@org_golang_google_protobuf//proto:go_default_library",
],
)
+
+go_test(
+ name = "go_default_test",
+ srcs = ["node_test.go"],
+ embed = [":go_default_library"],
+ deps = ["//metropolis/node/core/curator:go_default_library"],
+)