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

Refactor procedure to compute endpoint target map #1950

Closed

Conversation

sawsa307
Copy link
Contributor

Refactor the code that compute endpoint target map into a separate function computeTargetMap.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 14, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @sawsa307. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 14, 2023
@k8s-ci-robot k8s-ci-robot requested review from aojea and MrHohn February 14, 2023 20:36
@sawsa307
Copy link
Contributor Author

/assign @swetharepakula

@sawsa307 sawsa307 force-pushed the refactor-calculate-targetmap branch 2 times, most recently from 0d160cf to 8ed95f6 Compare February 14, 2023 21:49
targetMap, endpointPodMap, err = s.computeTargetMap(endpointSlices)
if err != nil {
return err
}
}
} else {
ep, exists, err := s.endpointLister.Get(
Copy link
Member

Choose a reason for hiding this comment

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

Interesting, since EndpointSlices is GA since 1.21, maybe we can start removing all the Endpoints code

Copy link
Contributor Author

@sawsa307 sawsa307 Feb 15, 2023

Choose a reason for hiding this comment

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

Hi Antontio. Regarding this, I asked Swetha about it. This change is already on the calendar, and it will be in a separate PR. For now, we refactor this part of code since in degraded mode, we will do this calculation differently.

Copy link
Member

Choose a reason for hiding this comment

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

Made #1973 to remove endpoints codepath

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 17, 2023
@sawsa307 sawsa307 force-pushed the refactor-calculate-targetmap branch from 8ed95f6 to 530a18d Compare February 17, 2023 08:17
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 17, 2023
Comment on lines 263 to 271
} else {
targetMap, endpointPodMap, err = s.computeTargetMap(endpointSlices)
if err != nil {
return err
}
Copy link
Member

Choose a reason for hiding this comment

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

Why is the computation in the else block? Don't we always need to compute the target map?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove the condition. Now we only do computeTargetMap.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 25, 2023
@sawsa307 sawsa307 force-pushed the refactor-calculate-targetmap branch from 530a18d to 9e0f1ae Compare February 27, 2023 10:20
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 27, 2023
@sawsa307 sawsa307 force-pushed the refactor-calculate-targetmap branch from 9e0f1ae to 27e5ff3 Compare February 27, 2023 22:40
}
if err != nil {
return negtypes.NewNegSyncResult(fmt.Errorf("endpoints calculation error in mode %q, err: %w", s.endpointsCalculator.Mode(), err), negtypes.ResultOtherError)
if s.inErrorState() {
Copy link
Member

Choose a reason for hiding this comment

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

this means we will not compute the target map if we are in error state? What do we do in that case?

@swetharepakula
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 27, 2023
@sawsa307 sawsa307 force-pushed the refactor-calculate-targetmap branch 2 times, most recently from 4975308 to 6f35925 Compare February 28, 2023 00:45
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 28, 2023
@sawsa307 sawsa307 force-pushed the refactor-calculate-targetmap branch from 6f35925 to e61adc8 Compare February 28, 2023 01:10
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 28, 2023
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 28, 2023
@sawsa307 sawsa307 closed this Feb 28, 2023
@sawsa307 sawsa307 force-pushed the refactor-calculate-targetmap branch from 0265b92 to 8da6eb2 Compare February 28, 2023 22:51
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sawsa307

The full list of commands accepted by this bot can be found 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 size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 28, 2023
@sawsa307 sawsa307 deleted the refactor-calculate-targetmap branch February 28, 2023 22:56
@sawsa307 sawsa307 restored the refactor-calculate-targetmap branch February 28, 2023 22:56
@sawsa307
Copy link
Contributor Author

sawsa307 commented Mar 3, 2023

Closed due to change of implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants