Skip to content

Commit

Permalink
chore: Fix spurious discovered lines in logging (aws#6481)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis authored Jul 10, 2024
1 parent 813e182 commit b8c2c88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions pkg/providers/securitygroup/securitygroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ func (p *DefaultProvider) List(ctx context.Context, nodeClass *v1beta1.EC2NodeCl
if err != nil {
return nil, err
}
if p.cm.HasChanged(fmt.Sprintf("security-groups/%s", nodeClass.Name), securityGroups) {
securityGroupIDs := lo.Map(securityGroups, func(s *ec2.SecurityGroup, _ int) string { return aws.StringValue(s.GroupId) })
if p.cm.HasChanged(fmt.Sprintf("security-groups/%s", nodeClass.Name), securityGroupIDs) {
log.FromContext(ctx).
WithValues("security-groups", lo.Map(securityGroups, func(s *ec2.SecurityGroup, _ int) string {
return aws.StringValue(s.GroupId)
})).
WithValues("security-groups", securityGroupIDs).
V(1).Info("discovered security groups")
}
return securityGroups, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/subnet/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (p *DefaultProvider) List(ctx context.Context, nodeClass *v1beta1.EC2NodeCl
}
}
p.cache.SetDefault(fmt.Sprint(hash), lo.Values(subnets))
if p.cm.HasChanged(fmt.Sprintf("subnets/%s", nodeClass.Name), subnets) {
if p.cm.HasChanged(fmt.Sprintf("subnets/%s", nodeClass.Name), lo.Keys(subnets)) {
log.FromContext(ctx).
WithValues("subnets", lo.Map(lo.Values(subnets), func(s *ec2.Subnet, _ int) v1beta1.Subnet {
return v1beta1.Subnet{
Expand Down

0 comments on commit b8c2c88

Please sign in to comment.