-
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
panic: assignment to entry in nil map #776
Conversation
/assign @linki |
provider/google.go
Outdated
RecordTTL: endpoint.TTL(r.Ttl), | ||
} | ||
targets := make(endpoint.Targets, 0, len(r.Rrdatas)) | ||
ep := endpoint.NewEndpointWithTTL(strings.TrimSuffix(r.Name, "."), r.Type, endpoint.TTL(r.Ttl), targets...) |
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.
.TrimSuffix
for dnsName is already part ofNewEndpointWithTTL
so we can leave it out here- we could also remove the subsequent
for
forr.Rrdatas
by passing in the rawr.Rrdatas
as the last argument. refer to thecleanTargets
stuff inNewEndpointWithTTL
(if I see that correctly at this time of day).
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.
Thanks! 👍 I left a comment that could allow to remove some more code.
/assign @linki |
provider/google.go
Outdated
sort.Sort(ep.Targets) | ||
endpoints = append(endpoints, ep) | ||
sort.Sort(targets) | ||
endpoints = append(endpoints, endpoint.NewEndpointWithTTL(r.Name, r.Type, endpoint.TTL(r.Ttl), targets...)) |
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.
I think we can directly pass-in r.Rrdatas
as the last argument here, can't we?
Remove sorting of rrdatas
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: linki The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fix for #729