Skip to content

Commit

Permalink
Fix format on aws and endpoint files
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardocaylent committed Mar 5, 2024
1 parent 846f4b4 commit 294b4c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion endpoint/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func FilterEndpointsByOwnerID(ownerID string, eps []*Endpoint) []*Endpoint {
key := EndpointKey{DNSName: ep.DNSName, RecordType: ep.RecordType, SetIdentifier: ep.SetIdentifier}
if visited[key] { //Do not contain duplicated endpoints
log.Debugf(`Already loaded endpoint %v `, ep)
continue
continue
}
if endpointOwner, ok := ep.Labels[OwnerLabelKey]; !ok || endpointOwner != ownerID {
log.Debugf(`Skipping endpoint %v because owner id does not match, found: "%s", required: "%s"`, ep, endpointOwner, ownerID)
Expand Down
18 changes: 9 additions & 9 deletions provider/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -994,28 +994,28 @@ func changesByZone(zones map[string]*route53.HostedZone, changeSet Route53Change
continue
}
for _, z := range zones {
// IMPORTANT EXPLAIN: I tried to fix this in here but a lot of tests started to fail in cascade.
// IMPORTANT EXPLAIN: I tried to fix this in here but a lot of tests started to fail in cascade.
// Found that nil recordTypes are entering in this function
// So disabling the continue will skip the deletion of duplicated records
// But this is the way we want to go. Also adding more visibility using recordType on Debug
var recordType string
if c.ResourceRecordSet.Type != nil && *c.ResourceRecordSet.Type != "" {
recordType = *c.ResourceRecordSet.Type
recordType = *c.ResourceRecordSet.Type
} else {
recordType = "EmptyRecordType"
recordType = "EmptyRecordType"
}
log.Debugf("Creating key for %s to zone %s with type %s", hostname, aws.StringValue(z.Id), recordType)
key := fmt.Sprintf("%s_%s", hostname, recordType)
log.Debugf("Key Output: %s", key)
// Initialize the map for the current zone if it doesn't exist
if visitedHostnames[aws.StringValue(z.Id)] == nil {
visitedHostnames[aws.StringValue(z.Id)] = make(map[string]bool)
}
if visitedHostnames[aws.StringValue(z.Id)] == nil {
visitedHostnames[aws.StringValue(z.Id)] = make(map[string]bool)
}

if visitedHostnames[aws.StringValue(z.Id)][key] {
log.Debugf("Skipping duplicate %s to zone %s [Id: %s] Type: %s", hostname, aws.StringValue(z.Name), aws.StringValue(z.Id), recordType)
//continue
}
log.Debugf("Skipping duplicate %s to zone %s [Id: %s] Type: %s", hostname, aws.StringValue(z.Name), aws.StringValue(z.Id), recordType)
//continue
}
if c.ResourceRecordSet.AliasTarget != nil && aws.StringValue(c.ResourceRecordSet.AliasTarget.HostedZoneId) == sameZoneAlias {
// alias record is to be created; target needs to be in the same zone as endpoint
// if it's not, this will fail
Expand Down

0 comments on commit 294b4c6

Please sign in to comment.