Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upRefactor PV scheduling library into a separate package #75434
Conversation
k8s-ci-robot
added
do-not-merge/work-in-progress
release-note-none
kind/cleanup
size/XXL
cncf-cla: yes
needs-sig
needs-priority
labels
Mar 18, 2019
k8s-ci-robot
requested review from
childsb and
jsafrane
Mar 18, 2019
k8s-ci-robot
added
sig/apps
sig/scheduling
and removed
needs-sig
labels
Mar 18, 2019
cofyc
force-pushed the
cofyc:fix56098
branch
2 times, most recently
from
738daf1
to
de3bb0d
Mar 18, 2019
This comment has been minimized.
This comment has been minimized.
maicohjf
commented
Mar 18, 2019
•
|
Set configuration context $ kubectl config use-context k8s $kubectl get pv --all-namespaces --sort-by="metadata.name" >> |
cofyc
force-pushed the
cofyc:fix56098
branch
from
0b425c6
to
22d1333
Mar 18, 2019
cofyc
reviewed
Mar 18, 2019
| @@ -107,6 +107,8 @@ pkg/controller/volume/events | |||
| pkg/controller/volume/expand | |||
| pkg/controller/volume/persistentvolume | |||
| pkg/controller/volume/persistentvolume/options | |||
| pkg/controller/volume/persistentvolume/testing | |||
| pkg/controller/volume/scheduling | |||
This comment has been minimized.
This comment has been minimized.
cofyc
Mar 18, 2019
•
Author
Contributor
Code of testing and scheduling package is extracted from pkg/controller/volume/persistentvolume and has some lint failures. I didn't fix them because I don't want to make this PR too complicated. I will fix them in a follow up PR.
This comment has been minimized.
This comment has been minimized.
cofyc
reviewed
Mar 18, 2019
| // Inject error to the first | ||
| // kubeclient.PersistentVolumes.Create() call. All other calls | ||
| // will succeed. | ||
| {"create", "persistentvolumes", errors.New("Mock creation error")}, | ||
| {Verb: "create", Resource: "persistentvolumes", Error: errors.New("Mock creation error")}, |
This comment has been minimized.
This comment has been minimized.
cofyc
Mar 18, 2019
Author
Contributor
These key fields are required if we composite a public struct from another package, otherwise composite literal uses unkeyed fields is emitted by go vet.
cofyc
force-pushed the
cofyc:fix56098
branch
from
22d1333
to
4608ad8
Mar 18, 2019
cofyc
reviewed
Mar 18, 2019
| // NotSupportedProvisioner is a special provisioner name which can be set | ||
| // in storage class to indicate dynamic provisioning is not supported by | ||
| // the storage. | ||
| NotSupportedProvisioner = "kubernetes.io/no-provisioner" |
This comment has been minimized.
This comment has been minimized.
cofyc
Mar 18, 2019
Author
Contributor
These constants are duplicated from persistentvolume. A lot of places use private copy in persistentvolume, I can update them to use constants in this shared package in a follow up PR.
This comment has been minimized.
This comment has been minimized.
cofyc
reviewed
Mar 18, 2019
| @@ -38,7 +38,8 @@ import ( | |||
| clientcache "k8s.io/client-go/tools/cache" | |||
| "k8s.io/client-go/tools/record" | |||
| "k8s.io/kubernetes/pkg/api/legacyscheme" | |||
| "k8s.io/kubernetes/pkg/controller/volume/persistentvolume" | |||
| _ "k8s.io/kubernetes/pkg/apis/core/install" | |||
This comment has been minimized.
This comment has been minimized.
cofyc
Mar 18, 2019
•
Author
Contributor
Why I import this package explicitly is because we need to register core API types (e.g. v1.Pod used in this file) into legacyscheme.Scheme. In old code, it is registered implicitly in k8s.io/kubernetes/pkg/controller/volume/persistentvolume.
Another way is to use k8s.io/client-go/kubernetes/scheme which registers all non-internal API types by default.
cofyc
changed the title
WIP: Refactor PV scheduling library into separate package
Refactor PV scheduling library into separate package
Mar 18, 2019
k8s-ci-robot
removed
the
do-not-merge/work-in-progress
label
Mar 18, 2019
This comment has been minimized.
This comment has been minimized.
|
/assign @msau42 |
k8s-ci-robot
assigned
msau42
Mar 18, 2019
k8s-ci-robot
added
the
needs-rebase
label
Mar 24, 2019
cofyc
force-pushed the
cofyc:fix56098
branch
from
4608ad8
to
dac3b79
Mar 24, 2019
k8s-ci-robot
removed
the
needs-rebase
label
Mar 24, 2019
k8s-ci-robot
added
the
needs-rebase
label
Apr 21, 2019
This comment has been minimized.
This comment has been minimized.
|
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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. I understand the commands that are listed here. |
This comment has been minimized.
This comment has been minimized.
|
/lgtm |
k8s-ci-robot
added
lgtm
priority/important-soon
and removed
needs-priority
labels
Apr 25, 2019
This was referenced Apr 25, 2019
This comment has been minimized.
This comment has been minimized.
|
cc @derekwaynecarr ask for approval on |
k8s-ci-robot
added
the
needs-rebase
label
May 1, 2019
cofyc
added some commits
Mar 18, 2019
cofyc
force-pushed the
cofyc:fix56098
branch
from
6ea9a25
to
ac12a9b
May 2, 2019
k8s-ci-robot
removed
lgtm
needs-rebase
labels
May 2, 2019
cofyc
force-pushed the
cofyc:fix56098
branch
from
ac12a9b
to
214ea1a
May 2, 2019
This comment has been minimized.
This comment has been minimized.
|
resolved some conflicts with #75848, no code change |
This comment has been minimized.
This comment has been minimized.
|
/retest |
1 similar comment
This comment has been minimized.
This comment has been minimized.
|
/retest |
This comment has been minimized.
This comment has been minimized.
|
@msau42 rebased without code change, please LGTM again |
This comment has been minimized.
This comment has been minimized.
|
cc @liggitt ask for approval on pkg/controller/BUILD which is modified by a new package under pkg/controller/volume. Thanks! |
This comment has been minimized.
This comment has been minimized.
|
/lgtm |
k8s-ci-robot
added
the
lgtm
label
May 3, 2019
This comment has been minimized.
This comment has been minimized.
|
cc @thockin ask for an approval on pkg/controller because BUILD file is modified by a new package under pkg/controller/volume. Thanks! |
This comment has been minimized.
This comment has been minimized.
|
/approve |
This comment has been minimized.
This comment has been minimized.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cblecker, cofyc, Huang-Wei, mikedanese, 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 |
k8s-ci-robot
added
the
approved
label
May 4, 2019
k8s-ci-robot
merged commit ef550e6
into
kubernetes:master
May 4, 2019
19 of 20 checks passed
cofyc
deleted the
cofyc:fix56098
branch
May 4, 2019
This comment has been minimized.
This comment has been minimized.
|
@mikedanese Thanks! |
cofyc commentedMar 18, 2019
•
edited
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #56098
Special notes for your reviewer:
The refactoring is basically simple, but lots of code need to be extracted into shared places (
testing,util) to be used bypersistentvolumeand volumeschedulingpackages.pkg/controller/volume/persistentvolume/testingpkg/controller/volume/persistentvolume/utilpkg/controller/volume/schedulingDoes this PR introduce a user-facing change?: