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 mount fakes #81423

Merged
merged 3 commits into from
Nov 8, 2019
Merged

Conversation

codenrhoden
Copy link
Contributor

@codenrhoden codenrhoden commented Aug 14, 2019

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
As part of the review for kubernetes/utils#100, it was requested to put all fakes in a testing subpackage.

After discussion, a different package structures was agreed on with @saad-ali and @thockin, see #81423 (review).

This patch moves fake.go to mount_fake.go, and follows to principle of
always returning a discrete type rather than an Interface. All callers
of "FakeMounter" are changed to instead use "NewFakeMounter()". The
FakeMounter "Log" struct member is changed to not be exported, and
instead only access through a new "GetLog()" method.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Aug 14, 2019
@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 14, 2019
@codenrhoden codenrhoden force-pushed the mount-testing-pkg branch 4 times, most recently from fc7ff43 to 922f57c Compare August 14, 2019 18:25
@k8s-ci-robot k8s-ci-robot added the sig/apps Categorizes an issue or PR as relevant to SIG Apps. label Aug 14, 2019
@codenrhoden codenrhoden force-pushed the mount-testing-pkg branch 2 times, most recently from ef76cb4 to 6e04067 Compare August 14, 2019 19:24
@k8s-ci-robot k8s-ci-robot added area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Aug 14, 2019
@codenrhoden codenrhoden force-pushed the mount-testing-pkg branch 2 times, most recently from 1af5f48 to ecfd6e2 Compare August 15, 2019 00:07
@codenrhoden
Copy link
Contributor Author

OMG. Just realized, thanks to this test result that moving to a types package resolves our issue with the golinter! This means that the package now is all good from the linting perspective, negating all the issues raised in #81186. 🎉

Copy link
Contributor

@mattjmcnaughton mattjmcnaughton left a comment

Choose a reason for hiding this comment

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

Mind addressing the govet failures that are causing pull-kubernetes-verify to fail.

/test pull-kubernetes-bazel-test

Since this is such a big diff, I imagine we'll rely pretty heavily on CI for validation, so going to wait for that to be green before reviewing.

Also, to confirm - this pr changes no functionality correct? It just changes the modules of certain functionality?

@msau42
Copy link
Member

msau42 commented Aug 15, 2019

@kubernetes/sig-storage-pr-reviews
/assign

@codenrhoden
Copy link
Contributor Author

Mind addressing the govet failures that are causing pull-kubernetes-verify to fail.

yep, of course. Should be done now.

Also, to confirm - this pr changes no functionality correct? It just changes the modules of certain functionality?

That's the idea. The only real change is that in order for the FakeMounter to be independent in the testing package, it can't call into shared functions found in the top level mount package. There were two places that did this. They were simple pieces of re-used logic, and I merely copied them over. So - some logic is copied. That's probably worth pointing out. Doesn't change the "real" implementation, only the fake one.

@codenrhoden
Copy link
Contributor Author

/retest

3 similar comments
@codenrhoden
Copy link
Contributor Author

/retest

@codenrhoden
Copy link
Contributor Author

/retest

@codenrhoden
Copy link
Contributor Author

/retest

@codenrhoden
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce-storage-slow

@codenrhoden
Copy link
Contributor Author

/retest

1 similar comment
@codenrhoden
Copy link
Contributor Author

/retest

@jsafrane
Copy link
Member

jsafrane commented Nov 7, 2019

/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 Nov 7, 2019
@codenrhoden
Copy link
Contributor Author

/assign @Random-Liu @derekwaynecarr @tallclair
Any chance I can get a kubelet approver?

@dims
Copy link
Member

dims commented Nov 7, 2019

/milestone v1.17

@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Nov 7, 2019
@derekwaynecarr
Copy link
Member

the kubelet changes all look like straight forward refactors.

thanks!

/approve
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: codenrhoden, derekwaynecarr, jsafrane, msau42

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 Nov 8, 2019
@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.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

This patch moves fake.go to mount_fake.go, and follows to principle of
always returning a discrete type rather than an Interface. All callers
of "FakeMounter" are changed to instead use "NewFakeMounter()". The
FakeMounter "Log" struct member is changed to not be exported, and
instead only access through a new "GetLog()" method.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2019
@vladimirvivien
Copy link
Member

/lgtm

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

Rebased after a new merge conflict in the same PR batch. Needed to add this line to use the new struct member added in a different PR: https://github.com/kubernetes/kubernetes/pull/81423/files#diff-b962320d780ac74dffce9da68eda4f4cR616

@k8s-ci-robot k8s-ci-robot merged commit 8b123b1 into kubernetes:master Nov 8, 2019
@codenrhoden codenrhoden deleted the mount-testing-pkg branch November 8, 2019 22:35
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. area/kubelet 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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.