m/n/core/rpc: add ClusterResolver

This is a first-pass implementation of a baseline, functioning, but not
fully featured gRPC resolver builder that connects to a given Metropolis
cluster based on just a single functioning node.

This is planned to be extended to be aware of node health, and possibly
curator leadership. It will then replace the main roleserver client and
allow metroctl to connect to a cluster given just a single node.

Change-Id: I8321a6ce19bdaead35b5f266dd9774ce1b78f075
Reviewed-on: https://review.monogon.dev/c/monogon/+/637
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/node/core/rpc/BUILD.bazel b/metropolis/node/core/rpc/BUILD.bazel
index 9b171e3..e4ff25f 100644
--- a/metropolis/node/core/rpc/BUILD.bazel
+++ b/metropolis/node/core/rpc/BUILD.bazel
@@ -6,6 +6,7 @@
         "client.go",
         "methodinfo.go",
         "peerinfo.go",
+        "resolver.go",
         "server.go",
         "server_authentication.go",
         "testhelpers.go",
@@ -20,10 +21,12 @@
         "//metropolis/pkg/pki",
         "//metropolis/proto/api",
         "//metropolis/proto/ext",
+        "@com_github_cenkalti_backoff_v4//:backoff",
         "@org_golang_google_grpc//:go_default_library",
         "@org_golang_google_grpc//codes",
         "@org_golang_google_grpc//credentials",
         "@org_golang_google_grpc//peer",
+        "@org_golang_google_grpc//resolver",
         "@org_golang_google_grpc//status",
         "@org_golang_google_protobuf//encoding/prototext",
         "@org_golang_google_protobuf//proto",
@@ -35,6 +38,7 @@
 go_test(
     name = "rpc_test",
     srcs = [
+        "resolver_test.go",
         "server_authentication_test.go",
         "trace_test.go",
     ],
@@ -43,9 +47,11 @@
         "//metropolis/node/core/curator/proto/api",
         "//metropolis/pkg/logtree",
         "//metropolis/proto/api",
+        "//metropolis/proto/common",
         "//metropolis/proto/ext",
         "@org_golang_google_grpc//:go_default_library",
         "@org_golang_google_grpc//codes",
+        "@org_golang_google_grpc//credentials",
         "@org_golang_google_grpc//status",
         "@org_golang_google_grpc//test/bufconn",
     ],