Skip to content
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

Merged
merged 6 commits into from
Nov 21, 2018
Merged

Conversation

njuettner
Copy link
Member

Fix for #729

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 20, 2018
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 20, 2018
@njuettner njuettner requested review from linki and removed request for justinsb and iterion November 20, 2018 15:31
@njuettner
Copy link
Member Author

/assign @linki

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...)
Copy link
Member

@linki linki Nov 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/kubernetes-incubator/external-dns/blob/1ed5fa6952430456bcf0efb6ce3724bfd6028f8a/endpoint/endpoint.go#L139:6

  • .TrimSuffix for dnsName is already part of NewEndpointWithTTL so we can leave it out here
  • we could also remove the subsequent for for r.Rrdatas by passing in the raw r.Rrdatas as the last argument. refer to the cleanTargets stuff in NewEndpointWithTTL (if I see that correctly at this time of day).

Copy link
Member

@linki linki left a 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.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 21, 2018
@njuettner
Copy link
Member Author

/assign @linki

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...))
Copy link
Member

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?

@linki linki closed this Nov 21, 2018
@linki linki reopened this Nov 21, 2018
@linki
Copy link
Member

linki commented Nov 21, 2018

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 21, 2018
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 21, 2018
@k8s-ci-robot k8s-ci-robot merged commit cca3e72 into master Nov 21, 2018
@Priyankasaggu11929 Priyankasaggu11929 deleted the google-panic-assignment branch August 17, 2023 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. provider/google size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants