external-dns icon indicating copy to clipboard operation
external-dns copied to clipboard

optimize endpoints Targets struct

Open dongjiang1989 opened this issue 1 year ago • 3 comments
trafficstars

What would you like to be added:

 it may call ParseAddr many times for the same target.
So let's give us one more chance to avoid that. I have an other idea.

Wdyt about converting Target from a string to a struct with a string and Addr* ?
It would mean it may use Addr when it's relevant and keep string comparison when it's not an IP ?

Originally posted by @mloiseleur in https://github.com/kubernetes-sigs/external-dns/pull/4351#issuecomment-2042507179

Why is this needed:

change Targets from []string to []Target

type Target struct {
	Addr netip.Addr
	Raw  string
}
// Targets is a representation of a list of targets for an endpoint.
type Targets []Target
### Tasks
- [ ] https://github.com/kubernetes-sigs/external-dns/pull/4351
- [ ] https://github.com/kubernetes-sigs/external-dns/pull/4379

dongjiang1989 avatar Apr 10 '24 06:04 dongjiang1989

/cc @mloiseleur I'll add a follow-up PR to optimize it.

dongjiang1989 avatar Apr 10 '24 06:04 dongjiang1989

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jul 09 '24 14:07 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Aug 08 '24 15:08 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Sep 07 '24 15:09 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

k8s-ci-robot avatar Sep 07 '24 15:09 k8s-ci-robot