runtime/v2: Log BootstrapParams

Recent work added the ability to use grpc for shims, it'd be nice to
have a debug (or info perhaps) log to show what protocol and addr the
shim sent over.

Signed-off-by: Danny Canter <danny@dcantah.dev>
This commit is contained in:
Danny Canter 2023-02-16 17:21:27 -08:00
parent 8d4f9b6335
commit 979a744122

View File

@ -29,6 +29,7 @@ import (
"github.com/containerd/ttrpc" "github.com/containerd/ttrpc"
"github.com/hashicorp/go-multierror" "github.com/hashicorp/go-multierror"
"github.com/sirupsen/logrus"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/credentials/insecure"
@ -220,6 +221,11 @@ func makeConnection(ctx context.Context, address string, onClose func()) (_ io.C
params.Protocol = "ttrpc" params.Protocol = "ttrpc"
} }
log.G(ctx).WithFields(logrus.Fields{
"address": params.Address,
"protocol": params.Protocol,
}).Debug("shim bootstrap parameters")
switch strings.ToLower(params.Protocol) { switch strings.ToLower(params.Protocol) {
case "ttrpc": case "ttrpc":
conn, err := client.Connect(params.Address, client.AnonReconnectDialer) conn, err := client.Connect(params.Address, client.AnonReconnectDialer)