From 7e505de1d09ec39ee3b67a74bb2d9a9cf5b53cf4 Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Tue, 15 Oct 2024 10:27:50 +0200 Subject: [PATCH] Log the used connection timeout on debug output The timeout is not logged when the endpoint is explicitly set. We now add this information to hint that a `0` timeout also defaults to the `2s` default after conversion. Signed-off-by: Sascha Grunert --- cmd/crictl/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/crictl/main.go b/cmd/crictl/main.go index aa9d218df3..9924264928 100644 --- a/cmd/crictl/main.go +++ b/cmd/crictl/main.go @@ -72,13 +72,14 @@ func getRuntimeService(_ *cli.Context, timeout time.Duration) (res internalapi.R if RuntimeEndpointIsSet && RuntimeEndpoint == "" { return nil, errors.New("--runtime-endpoint is not set") } - logrus.Debug("get runtime connection") + logrus.Debug("Get runtime connection") // Check if a custom timeout is provided. t := Timeout if timeout != 0 { t = timeout } + logrus.Debugf("Using runtime connection timeout: %v", t) // Use the noop tracer provider and not tracerProvider directly, otherwise // we'll panic in the unary call interceptor @@ -124,7 +125,7 @@ func getImageService(*cli.Context) (res internalapi.ImageManagerService, err err ImageEndpointIsSet = RuntimeEndpointIsSet } - logrus.Debugf("get image connection") + logrus.Debug("Get image connection") // Use the noop tracer provider and not tracerProvider directly, otherwise // we'll panic in the unary call interceptor @@ -137,7 +138,7 @@ func getImageService(*cli.Context) (res internalapi.ImageManagerService, err err // If no EP set then use the default endpoint types if !ImageEndpointIsSet { - logrus.Warningf("image connect using default endpoints: %v. "+ + logrus.Warningf("Image connect using default endpoints: %v. "+ "As the default settings are now deprecated, you should set the "+ "endpoint instead.", defaultRuntimeEndpoints) logrus.Debug("Note that performance maybe affected as each default " +