Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Anderson Queiroz <me@andersonq.me>
  • Loading branch information
pchila and AndersonQ authored Apr 12, 2024
1 parent 23507f5 commit 0fff76a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 0fff76a

Please sign in to comment.