Skip to content

Commit

Permalink
Log the used connection timeout on debug output
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
saschagrunert committed Oct 15, 2024
1 parent 9c6a3c8 commit 7e505de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/crictl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 " +
Expand Down

0 comments on commit 7e505de

Please sign in to comment.