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

Fix IPVS service Flags #52330

Merged
merged 1 commit into from Sep 24, 2017

Conversation

m1093782566
Copy link
Contributor

@m1093782566 m1093782566 commented Sep 12, 2017

What this PR does / why we need it:

Which issue this PR fixes:

fixes #52393

Special notes for your reviewer:

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 12, 2017
@k8s-ci-robot
Copy link
Contributor

@m1093782566: Your pull request title starts with "[WIP]", so the do-not-merge/work-in-progress label will be added.

This label will ensure that your pull request will not be merged. Remove the prefix from your pull request title to trigger the removal of the label and allow for your pull request to be merged.

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/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 12, 2017
@k8s-github-robot k8s-github-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Sep 12, 2017
@m1093782566 m1093782566 changed the title [WIP] Fix IPVS service equal Fix IPVS service equal Sep 13, 2017
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 13, 2017
@m1093782566 m1093782566 changed the title Fix IPVS service equal Fix IPVS service Flags Sep 13, 2017
Timeout: svc.Timeout,
}

if svc.Flags < uint32(FlagHashed) {
Copy link
Member

Choose a reason for hiding this comment

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

If flags are treated as a bitmap, we should use bit tests for them,

if svc.Flags & FlagHashed == 0, and so on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. It's fixed now. Please take a look?

@m1093782566 m1093782566 force-pushed the ipvs-service-equal branch 2 times, most recently from fca83ea to 6b9e414 Compare September 19, 2017 01:17
if svc.Flags&FlagHashed == 0 {
return nil, fmt.Errorf("Flags of successfully created IPVS service should be >= %d since every service is hashed into the service table", FlagHashed)
}
vs.Flags = ServiceFlags(svc.Flags - uint32(FlagHashed))
Copy link
Member

Choose a reason for hiding this comment

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

I would say &^, buut OK

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 understand your meaning, since the valid value range is [2, 3] for now, I think it's fine to use bit operator &^. Then, we need to update test cases because a &^ b is not always equal to a - b. BTW, I would like to add some comments...

@@ -162,7 +162,7 @@ func Test_toFrontendService(t *testing.T) {
Protocol: "UDP",
Port: 33434,
Scheduler: "wlc",
Flags: 1234,
Flags: 1232,
Copy link
Member

Choose a reason for hiding this comment

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

constants please?

@@ -128,7 +128,7 @@ func Test_toFrontendService(t *testing.T) {
Port: 80,
FWMark: 0,
SchedName: "",
Flags: 0,
Flags: 2,
Copy link
Member

Choose a reason for hiding this comment

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

constants please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, Please check it and below.

@@ -172,7 +172,7 @@ func Test_toFrontendService(t *testing.T) {
Port: 0,
FWMark: 0,
SchedName: "lc",
Flags: 0,
Flags: 3,
Copy link
Member

Choose a reason for hiding this comment

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

constants please?

@@ -184,7 +184,7 @@ func Test_toFrontendService(t *testing.T) {
Protocol: "",
Port: 0,
Scheduler: "lc",
Flags: 0,
Flags: 1,
Copy link
Member

Choose a reason for hiding this comment

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

constants please?

@@ -194,7 +194,7 @@ func Test_toFrontendService(t *testing.T) {
Port: 0,
FWMark: 0,
SchedName: "wrr",
Flags: 0,
Flags: 10,
Copy link
Member

Choose a reason for hiding this comment

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

constants please?

@@ -206,7 +206,7 @@ func Test_toFrontendService(t *testing.T) {
Protocol: "",
Port: 0,
Scheduler: "wrr",
Flags: 0,
Flags: 8,
Copy link
Member

Choose a reason for hiding this comment

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

constants please?

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 20, 2017
@m1093782566 m1093782566 force-pushed the ipvs-service-equal branch 2 times, most recently from 698ab39 to 1003204 Compare September 20, 2017 08:38
@thockin
Copy link
Member

thockin commented Sep 20, 2017

/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 Sep 20, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: m1093782566, thockin

Associated issue: 52393

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 20, 2017
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to @fejta).

Review the full test history for this PR.

@m1093782566 m1093782566 mentioned this pull request Sep 21, 2017
13 tasks
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 52469, 52574, 52330, 52689, 52829). If you want to cherry-pick this change to another branch, please follow the instructions here..

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. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IPVS proxier keeps updating virtual server even if no service changes
6 participants