Skip to content

Commit

Permalink
refactor: use defer for log
Browse files Browse the repository at this point in the history
Signed-off-by: KevFan <[email protected]>
  • Loading branch information
KevFan committed Jan 15, 2025
1 parent efcaf7e commit e32bc81
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions controllers/tlspolicies_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func (r *TLSPoliciesValidator) Validate(ctx context.Context, _ []controller.Reso

policies := lo.Filter(topology.Policies().Items(), filterForTLSPolicies)
logger.V(1).Info("validating tls policies", "policies", len(policies))
defer logger.V(1).Info("finished validating tls policies")

state.Store(TLSPolicyAcceptedKey, lo.SliceToMap(policies, func(p machinery.Policy) (string, error) {
if err := r.isMissingDependency(); err != nil {
Expand Down Expand Up @@ -79,8 +80,6 @@ func (r *TLSPoliciesValidator) Validate(ctx context.Context, _ []controller.Reso
return p.GetLocator(), nil
}))

logger.V(1).Info("finished validating tls policies")

return nil
}

Expand Down

0 comments on commit e32bc81

Please sign in to comment.