metropolis: stub out log service
The server side and client-side implementations are not quite ready yet,
but we're commiting this early so that we can start implementing more
node-local management RPCs.
Change-Id: I81b615b0f77dc7750cc738d60ee4923c3182721b
Reviewed-on: https://review.monogon.dev/c/monogon/+/1429
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/cli/metroctl/rpc.go b/metropolis/cli/metroctl/rpc.go
index 8e8ee48..6d7beab 100644
--- a/metropolis/cli/metroctl/rpc.go
+++ b/metropolis/cli/metroctl/rpc.go
@@ -2,6 +2,7 @@
import (
"context"
+ "crypto/x509"
"log"
"google.golang.org/grpc"
@@ -25,3 +26,17 @@
}
return cc
}
+
+func dialAuthenticatedNode(ctx context.Context, id, address string, cacert *x509.Certificate) *grpc.ClientConn {
+ // Collect credentials, validate command parameters, and try dialing the
+ // cluster.
+ ocert, opkey, err := core.GetOwnerCredentials(flags.configPath)
+ if err == core.NoCredentialsError {
+ log.Fatalf("You have to take ownership of the cluster first: %v", err)
+ }
+ cc, err := core.DialNode(ctx, opkey, ocert, cacert, flags.proxyAddr, id, address)
+ if err != nil {
+ log.Fatalf("While dialing node: %v", err)
+ }
+ return cc
+}