From 0fff76ab19373aa644bc2b7a5432b0ef2874a9e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paolo=20Chil=C3=A0?= Date: Fri, 12 Apr 2024 08:14:04 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Anderson Queiroz --- .../actions/handlers/handler_action_policy_change.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/pkg/agent/application/actions/handlers/handler_action_policy_change.go b/internal/pkg/agent/application/actions/handlers/handler_action_policy_change.go index e1f95accdb4..90dcffbd053 100644 --- a/internal/pkg/agent/application/actions/handlers/handler_action_policy_change.go +++ b/internal/pkg/agent/application/actions/handlers/handler_action_policy_change.go @@ -129,11 +129,11 @@ func (h *PolicyChangeHandler) validateFleetServerHosts(ctx context.Context, cfg return nil, nil } - // make a copy the current client config and apply the changes in place on this copy + // make a copy of the current client config and apply the changes in place to this this copy. newFleetClientConfig := h.config.Fleet.Client updateFleetConfig(h.log, cfg.Fleet.Client, &newFleetClientConfig) - // Test new config + // Test the new config err := testFleetConfig(ctx, h.log, newFleetClientConfig, h.config.Fleet.AccessAPIKey) if err != nil { return nil, fmt.Errorf("validating fleet client config: %w", err) @@ -242,7 +242,7 @@ func (h *PolicyChangeHandler) applyFleetClientConfig(validatedConfig *remote.Con h.config.Fleet.Client = *validatedConfig - // the config has already been validated, no need for error handling + // the config has already been validated, it should not error. fleetClient, err := client.NewAuthWithConfig( h.log, h.config.Fleet.AccessAPIKey, *validatedConfig) if err != nil {