-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: duplicated endpoint per hosted zone #4296
Merged
k8s-ci-robot
merged 28 commits into
kubernetes-sigs:master
from
leonardocaylent:bugfix/group-endpoints-per-hosted-zone-for-aws
May 10, 2024
Merged
Changes from 4 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
b8053fe
Group By Endpoint names per Hosted Zone on AWS
leonardocaylent e55200a
Group By Endpoint names per Hosted Zone on AWS
leonardocaylent 7c7a1c3
Group By Endpoint names per Hosted Zone on AWS
leonardocaylent 9307374
Group By Endpoint names per Hosted Zone on AWS
leonardocaylent 846f4b4
Going back to endpoint.go
leonardocaylent 294b4c6
Fix format on aws and endpoint files
leonardocaylent 0308cc2
Fix Lint
leonardocaylent 3395eba
Add const to avoid Lint
leonardocaylent cea0496
Revert "Fix Lint"
leonardocaylent a3826d5
Update endpoint.go with Key function
leonardocaylent 30c9e77
Fix lint
leonardocaylent f4f39d8
Merge branch 'kubernetes-sigs:master' into bugfix/group-endpoints-per…
leonardocaylent 0ca2796
Fix Lint
leonardocaylent 82046cc
Removing comments and clean up
leonardocaylent d3c2f47
Merge remote-tracking branch 'origin/master' into bugfix/group-endpoi…
leonardocaylent 7fe2d3f
Fix for duplicated endpoints and unit tests
leonardocaylent 2b3da1b
Fix for duplicated endpoints and unit tests
leonardocaylent 6066b70
Fix for duplicated endpoints
leonardocaylent 3ca4d02
Update endpoint/endpoint.go
leonardocaylent 17ce6b4
Merge remote-tracking branch 'origin/master' into bugfix/group-endpoi…
leonardocaylent deba1ea
Fix suggestions
leonardocaylent 4fb2f2e
Specific bugfix near the root cause for duplicated deletes on plan.go
leonardocaylent ba56b7a
Merge remote-tracking branch 'origin/master' into bugfix/group-endpoi…
leonardocaylent d9b7439
Specify and clarify root cause of issue 4241
leonardocaylent 05ca35e
Merge remote-tracking branch 'origin/master' into bugfix/group-endpoi…
leonardocaylent 64d0833
Final fix for error on delete
leonardocaylent 5190777
Fix unrelated change on service_test.go address
leonardocaylent 56024fd
Merge remote-tracking branch 'origin/master' into bugfix/group-endpoi…
leonardocaylent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -979,6 +979,7 @@ func sortChangesByActionNameType(cs Route53Changes) Route53Changes { | |||||
// changesByZone separates a multi-zone change into a single change per zone. | ||||||
func changesByZone(zones map[string]*route53.HostedZone, changeSet Route53Changes) map[string]Route53Changes { | ||||||
changes := make(map[string]Route53Changes) | ||||||
visitedHostnames := make(map[string]map[string]bool) | ||||||
|
||||||
for _, z := range zones { | ||||||
changes[aws.StringValue(z.Id)] = Route53Changes{} | ||||||
|
@@ -993,6 +994,18 @@ func changesByZone(zones map[string]*route53.HostedZone, changeSet Route53Change | |||||
continue | ||||||
} | ||||||
for _, z := range zones { | ||||||
log.Debugf("Creating key for %s to zone %s with type %s", hostname, aws.StringValue(z.Id), *c.ResourceRecordSet.Type) | ||||||
key := fmt.Sprintf("%s_%s", hostname, *c.ResourceRecordSet.Type) | ||||||
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)][key] { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
log.Debugf("Skipping duplicate %s to zone %s [Id: %s] Type: %s", hostname, aws.StringValue(z.Name), aws.StringValue(z.Id), *c.ResourceRecordSet.Type) | ||||||
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 | ||||||
|
@@ -1008,7 +1021,8 @@ func changesByZone(zones map[string]*route53.HostedZone, changeSet Route53Change | |||||
} | ||||||
} | ||||||
changes[aws.StringValue(z.Id)] = append(changes[aws.StringValue(z.Id)], c) | ||||||
log.Debugf("Adding %s to zone %s [Id: %s]", hostname, aws.StringValue(z.Name), aws.StringValue(z.Id)) | ||||||
visitedHostnames[aws.StringValue(z.Id)][key] = true | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
log.Debugf("Adding %s to zone %s [Id: %s] Type: %s", hostname, aws.StringValue(z.Name), aws.StringValue(z.Id), *c.ResourceRecordSet.Type) | ||||||
} | ||||||
} | ||||||
|
||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.