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 neg controller: processService, add unittest #856

Merged
merged 2 commits into from
Oct 23, 2019
Merged

refactor neg controller: processService, add unittest #856

merged 2 commits into from
Oct 23, 2019

Conversation

cadmuxe
Copy link
Member

@cadmuxe cadmuxe commented Sep 17, 2019

No description provided.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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 Sep 17, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @cadmuxe. 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 17, 2019
@cadmuxe
Copy link
Member Author

cadmuxe commented Sep 17, 2019

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 17, 2019
@cadmuxe cadmuxe marked this pull request as ready for review September 17, 2019 17:44
@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 17, 2019
@MrHohn
Copy link
Member

MrHohn commented Sep 17, 2019

/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. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 17, 2019
pkg/neg/controller.go Outdated Show resolved Hide resolved
pkg/neg/controller.go Outdated Show resolved Hide resolved
pkg/neg/controller.go Outdated Show resolved Hide resolved
pkg/neg/controller.go Outdated Show resolved Hide resolved
pkg/neg/controller.go Outdated Show resolved Hide resolved
pkg/neg/controller.go Outdated Show resolved Hide resolved
pkg/neg/controller.go Outdated Show resolved Hide resolved
pkg/neg/controller.go Outdated Show resolved Hide resolved
pkg/neg/controller.go Show resolved Hide resolved

result := controller.defaultBackendServicePortInfoMap()
result := make(negtypes.PortInfoMap)
controller.mergeDefaultBackendServicePortInfoMap(controller.defaultBackendService.ID.Service.String(), &result)
if !reflect.DeepEqual(tc.want, result) {
t.Fatalf("got %+v, want %+v", result, tc.want)
}
})
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

add a unit test for CSM NEG case similar to TestNewNEGService.

It should have combination of dummy services and destinationrules. And validate:

  1. The syncers are correct
  2. The annotation are correct

This is sort of a e2e test for processService in the CSM mode.

@freehan freehan self-assigned this Sep 20, 2019
pkg/neg/controller.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 7, 2019
@cadmuxe
Copy link
Member Author

cadmuxe commented Oct 7, 2019

Still working on the unittest.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 22, 2019
@freehan
Copy link
Contributor

freehan commented Oct 23, 2019

LGTM

Please squash commits. Just have one commit for vendoring, one for the refactoring+unit test.

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 23, 2019
@freehan
Copy link
Contributor

freehan commented Oct 23, 2019

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cadmuxe, freehan

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

@freehan freehan removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 23, 2019
@k8s-ci-robot k8s-ci-robot merged commit a9a78ad into kubernetes:master Oct 23, 2019
@cadmuxe cadmuxe deleted the csm branch October 23, 2019 00:58
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants