Skip to content

Commit a2ec32f

Browse files
committed
Reduce verbosity of logs when calling Runtime Extensions
Signed-off-by: Stefan Büringer buringerst@vmware.com
1 parent c4d1b8a commit a2ec32f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/runtime/client/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func (c *client) Discover(ctx context.Context, extensionConfig *runtimev1.Extens
139139

140140
// Check to see if the response is a failure and handle the failure accordingly.
141141
if response.GetStatus() == runtimehooksv1.ResponseStatusFailure {
142-
log.Info(fmt.Sprintf("failed to discover extension %q: got failure response with message %v", extensionConfig.Name, response.GetMessage()))
142+
log.Info(fmt.Sprintf("Failed to discover extension %q: got failure response with message %v", extensionConfig.Name, response.GetMessage()))
143143
// Don't add the message to the error as it is may be unique causing too many reconciliations. Ref: https://github.com/kubernetes-sigs/cluster-api/issues/6921
144144
return nil, errors.Errorf("failed to discover extension %q: got failure response", extensionConfig.Name)
145145
}
@@ -216,7 +216,7 @@ func (c *client) CallAllExtensions(ctx context.Context, hook runtimecatalog.Hook
216216
return errors.Wrapf(err, "failed to call extension handlers for hook %q", gvh.GroupHook())
217217
}
218218

219-
log.Info(fmt.Sprintf("Calling all extensions of hook %q", hookName))
219+
log.V(4).Info(fmt.Sprintf("Calling all extensions of hook %q", hookName))
220220
responses := []runtimehooksv1.ResponseObject{}
221221
for _, registration := range registrations {
222222
// Creates a new instance of the response parameter.
@@ -322,7 +322,7 @@ func (c *client) CallExtension(ctx context.Context, hook runtimecatalog.Hook, fo
322322
return errors.Errorf("failed to call extension handler %q: namespaceSelector did not match object %s", name, util.ObjectKey(forObject))
323323
}
324324

325-
log.Info(fmt.Sprintf("Calling extension handler %q", name))
325+
log.V(4).Info(fmt.Sprintf("Calling extension handler %q", name))
326326
timeoutDuration := runtimehooksv1.DefaultHandlersTimeoutSeconds * time.Second
327327
if registration.TimeoutSeconds != nil {
328328
timeoutDuration = time.Duration(*registration.TimeoutSeconds) * time.Second
@@ -365,7 +365,7 @@ func (c *client) CallExtension(ctx context.Context, hook runtimecatalog.Hook, fo
365365
if retryResponse, ok := response.(runtimehooksv1.RetryResponseObject); ok && retryResponse.GetRetryAfterSeconds() != 0 {
366366
log.Info(fmt.Sprintf("Extension handler returned blocking response with retryAfterSeconds of %d", retryResponse.GetRetryAfterSeconds()))
367367
} else {
368-
log.Info("Extension handler returned success response")
368+
log.V(4).Info("Extension handler returned success response")
369369
}
370370

371371
// Received a successful response from the extension handler. The `response` object

0 commit comments

Comments
 (0)