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

Rev k8s to 1.29 #8805

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

aaaaaaaalex
Copy link
Contributor

Description

Related issues/PRs

Todos

  • Tests
  • Documentation
  • Release note

Release Note

TBD

Reminder for the reviewer

Make sure that this PR has the correct labels and milestone set.

Every PR needs one docs-* label.

  • docs-pr-required: This change requires a change to the documentation that has not been completed yet.
  • docs-completed: This change has all necessary documentation completed.
  • docs-not-required: This change has no user-facing impact and requires no docs.

Every PR needs one release-note-* label.

  • release-note-required: This PR has user-facing changes. Most PRs should have this label.
  • release-note-not-required: This PR has no user-facing changes.

Other optional labels:

  • cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.
  • needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.

@aaaaaaaalex aaaaaaaalex requested a review from a team as a code owner May 9, 2024 10:10
@marvin-tigera marvin-tigera added this to the Calico v3.29.0 milestone May 9, 2024
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels May 9, 2024
@fasaxc
Copy link
Member

fasaxc commented May 9, 2024

Need to update all the library versions and "replace" pins too.

@aaaaaaaalex aaaaaaaalex force-pushed the rev-kubernetes-1-29 branch 2 times, most recently from 08ef870 to 00a31e1 Compare May 15, 2024 14:18
Copy link
Contributor

@tomastigera tomastigera left a comment

Choose a reason for hiding this comment

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

bpf side LGTM

Comment on lines +831 to +833
// REVIEWER TODO: is this likely correct? Port() func no longer returns error.
if tgtPort < 1 {
return errors.Errorf("no port for endpoint %q", ep)
Copy link
Contributor

Choose a reason for hiding this comment

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

feels like this should go. Probably handled where a string is converted to number already?

Endpoint: net.JoinHostPort(ep.Addr().String(), strconv.Itoa(int(ep.Port()))),
// IsLocal is not important here
},
NewEndpointInfo(ep.Addr().String(), int(ep.Port()), false, false, false, false, nil),
Copy link
Contributor

Choose a reason for hiding this comment

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

My preference in this place would be to use the struct so that it is a bit more obvious what is being set.

var _ k8sp.Endpoint = &endpointInfo{}

// NewEndpointInfo creates a new endpointInfo, returning it as a k8s proxy Endpoint.
func NewEndpointInfo(ip string, port int, isLocal, ready, serving, terminating bool, zoneHints sets.Set[string]) k8sp.Endpoint {
Copy link
Contributor

Choose a reason for hiding this comment

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

to an extent a nit and I do not think you need to change it in the tests, but for the future, my preferred patter is to have a function that takes manadatory arguments and them variadic functional options like https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis as they are quite a bit more expressive and more readable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tend to prefer that too, though in this case I was hoping to keep things somewhat similar to how the k8s-pkg equivalent was handling things. But I guess we have diverged now, anyway, so why not do it our preferred way :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-pr-required Change is not yet documented release-note-required Change has user-facing impact (no matter how small)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants