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

[scheduler cleanup phase 1]: Move FakeCache to pkg/scheduler/internal… #69318

Merged
merged 1 commit into from
Oct 10, 2018

Conversation

wgliang
Copy link
Contributor

@wgliang wgliang commented Oct 2, 2018

…/cache/fake

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #68959

Special notes for your reviewer:
@misterikkit

Release note:

Move FakeCache to pkg/scheduler/internal/cache/fake.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 2, 2018
@k8s-ci-robot k8s-ci-robot added sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 2, 2018
@shubheksha
Copy link
Contributor

/kind cleanup

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Oct 2, 2018
@timothysc
Copy link
Member

/assign @k82cn
/unassign @timothysc

@timothysc timothysc removed their request for review October 3, 2018 01:23
Copy link

@misterikkit misterikkit left a comment

Choose a reason for hiding this comment

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

I think you need to update the users to use the new import path.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 6, 2018
// FakeCache is used for testing
type FakeCache struct {
// Cache is used for testing
type Cache struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rewrite FakeCache to Cache for

Errors from golint:
pkg/scheduler/internal/cache/fake/fake_cache.go:26:6: type name will be used as fake.FakeCache by other packages, and that stutters; consider calling this Cache

@wgliang
Copy link
Contributor Author

wgliang commented Oct 6, 2018

/retest

@wgliang
Copy link
Contributor Author

wgliang commented Oct 7, 2018

/ping @misterikkit @k82cn @bsalamat

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package testing
package fake
Copy link
Member

Choose a reason for hiding this comment

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

Why not putting the file in scheduler/internal/cache instead of scheduler/internal/cache/fake?

Choose a reason for hiding this comment

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

Since the fake is meant for unit testing, we want a way to avoid importing it into production binaries. One way would be to call the file fake_test.go or we could just put it in a sub-package. Incidentally, this copies the convention from k8s.io/client-go/kubernetes/fake.

Copy link

@misterikkit misterikkit left a comment

Choose a reason for hiding this comment

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

/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 8, 2018
@wgliang
Copy link
Contributor Author

wgliang commented Oct 9, 2018

/ping @k82cn Please take a look :)
for approve

@bsalamat
Copy link
Member

bsalamat commented Oct 9, 2018

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bsalamat, wgliang

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

@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 9, 2018
@wgliang
Copy link
Contributor Author

wgliang commented Oct 10, 2018

/retest

@k8s-ci-robot k8s-ci-robot merged commit d3fe0ea into kubernetes:master Oct 10, 2018
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. 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.

[scheduler cleanup phase 1]: Move FakeCache to pkg/scheduler/internal/cache/fake
7 participants