Jan Safranek
e323306ce0
Add new watchers to PV controller tests
...
Add fake Pod and Node watchers to the tests. It only reduces test noise:
Failed to watch *v1.Pod: unhandled watch: testing.WatchActionImpl{ActionImpl:testing.ActionImpl{Namespace:"", Verb:"watch", Resource:schema.GroupVersionResource{Group:"", Version:"v1", Resource:"pods"}, Subresource:""}, WatchRestrictions:testing.WatchRestrictions{Labels:labels.internalSelector(nil), Fields:fields.andTerm{}, ResourceVersion:""}}
2021-12-21 15:36:34 +01:00
Hemant Kumar
7989f27044
use node informer to check volumes attachment status before backoff
...
fix unit tests
2021-12-20 11:57:05 -05:00
Davanum Srinivas
9405e9b55e
Check in OWNERS modified by update-yamlfmt.sh
...
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-09 21:31:26 -05:00
Kubernetes Prow Robot
12901b95c9
Merge pull request #106344 from ikeeip/fix_import_formatting
...
Fix golang imports in k8s.io/pkg/controller/volume/persistentvolume package
2021-12-07 17:26:40 -08:00
Léiyì Zhang
275fdf0884
fixing unit test failures induced by turning on CSIMigrationGCE
...
disable CSIMigrationGCE in some unit tests
2021-11-16 19:26:30 +00:00
Jan Safranek
bb8157d780
Fix deletion protection unit test
...
The test should not depend on current set of default feature gates, it
should always ensure the ones necessary for the tests are set.
2021-11-12 10:47:15 +01:00
Konstantin Misyutin
7434fdf1d4
fix import formatting in k8s.io/pkg/controller/volume/persistentvolume package
...
Signed-off-by: Konstantin Misyutin <konstantin.misyutin@huawei.com>
2021-11-11 16:31:38 +08:00
Deepak Kinni
bfd5f23a0b
PV controller changes to support PV Deletion protection finalizer
...
Signed-off-by: Deepak Kinni <dkinni@vmware.com>
2021-11-08 10:35:58 -08:00
Konstantin Misyutin
808c8f42d5
Remove StorageObjectInUseProtection feature gate logic
...
This feature has graduated to GA in v1.11 and will always be
enabled. So no longe need to check if enabled.
Signed-off-by: Konstantin Misyutin <konstantin.misyutin@huawei.com>
2021-11-03 00:13:50 +03:00
Mike Dame
4960d0976a
Wire contexts to Core controllers
2021-11-01 10:29:00 -04:00
Konstantin Misyutin
dbc9d7b71a
Remove tests when StorageObjectInUseProtection feature is disabled
...
As well as feature gate are locked, the tests when this feature is
disabled will crash. So we should remove them together with locking
the feature.
Signed-off-by: Konstantin Misyutin <konstantin.misyutin@huawei.com>
2021-10-15 19:39:37 +08:00
torubylist
f28a8d7f2b
fix:cached claim is not the newest will cause unexpected issue
2021-10-13 20:03:00 +08:00
Kubernetes Prow Robot
bcd2ffbdc1
Merge pull request #104590 from Jiawei0227/anno
...
Add GA AnnStorageProvisioner annotation to PVC
2021-09-03 06:09:49 -07:00
Jiawei Wang
8de0f11946
Add GA AnnStorageProvisioner annotation to PVC
...
This PR adds GA AnnStorageProvisioner annotation to
a PVC if the PVC requires dynamic provisioning. This
also deprecates the beta AnnStorageProvisioner annotation
and it will be removed in a later release.
2021-08-26 12:46:47 -07:00
Stephen Augustus
481cf6fbe7
generated: Run hack/update-gofmt.sh
...
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
Chris Henzie
83e3ee780a
Rename access mode contains helper method
...
So it is consistent with other methods performing the same check (one
for internal and external types)
2021-06-28 21:24:56 -07:00
Kubernetes Prow Robot
894803ab2e
Merge pull request #98199 from yangjunmyfm192085/run-test3
...
fix mistake about [avaliable] for index_test.go
2021-05-25 02:46:22 -07:00
Kubernetes Prow Robot
838a967be5
Merge pull request #101175 from lojies/cleanupforpvcontroller
...
code cleanup:remove redundant return statement in pv_controller.go
2021-05-24 21:48:49 -07:00
wangyx1992
fd51e654af
cleanup: fix errors in wrapped format and log capitalization in controller
...
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
2021-04-22 15:40:54 +08:00
卢振兴10069964
8009823867
code cleanup:remove redundant return statement in pv_controller.go
2021-04-16 09:02:21 +08:00
Kubernetes Prow Robot
5155865ae2
Merge pull request #99326 from sunpa93/fs_resize_fix
...
fix: use pv annotation to trigger filesystem resize when necessary
2021-03-09 11:05:18 -08:00
Kubernetes Prow Robot
dc74b9d0c7
Merge pull request #98753 from Jiawei0227/length
...
Relax csiNodeIDMaxLength to longer limit
2021-03-09 09:19:00 -08:00
Sung Jun Park
5f69cf74d8
fix: when newly binding pvc to a pv, adjust pvc.status.capacity to pv's annotation that denotes the pre-resize capacity of the original pvc that pv was bound to if it has one
...
test: confirm that pvc's status capacity is adjusted if pv has a pre-resize capacity annotation
2021-03-09 07:55:10 +00:00
Jiawei Wang
1e16615fb0
Relax csiNodeIDMaxLength to longer limit
...
Update csiNodeIDMaxLength to 192 bytes
2021-03-08 13:52:43 -08:00
Jan Safranek
219cbc818a
Refactor CSI migration plugin manager to get featureGates as a parameter
...
This allows caller to provide fake ones for testing of various corner cases
(migration on A/D controller disabled while enabled on kubelet).
2021-03-08 13:50:01 +01:00
Kubernetes Prow Robot
5498ee641b
Merge pull request #99561 from BenTheElder/remove-bazel
...
Remove Bazel
2021-03-01 09:55:27 -08:00
Kubernetes Prow Robot
f6152d1521
Merge pull request #97086 from xing-yang/check_datasource
...
Only CSI plugin can have a DataSource
2021-03-01 06:53:26 -08:00
Benjamin Elder
56e092e382
hack/update-bazel.sh
2021-02-28 15:17:29 -08:00
Kubernetes Prow Robot
c200a8f9b7
Merge pull request #98433 from damemi/remove-helper-from-volume-zone
...
Move GetPersistentVolumeClaimClass to component-helpers
2021-02-26 12:38:15 -08:00
xing-yang
676a3a7012
Only CSI plugin can have a DataSource
2021-02-25 15:27:26 +00:00
Jiawei Wang
3d61b56bcd
update bazel
2021-02-12 17:50:40 -08:00
Jiawei Wang
6a7222cf4e
Add migrated field to storage_operation_duration_seconds metric
2021-02-12 17:35:01 -08:00
wzshiming
fb518af0fc
Speed up pkg/controller/volume/persistentvolume unit tests
2021-02-05 15:09:36 +08:00
Mike Dame
ba72411aa2
Move GetPersistentVolumeClaimClass to component-helpers
...
The goal of this move is related to issue 89930, to break the dependence
of scheduling plugins on internal helpers. This function can easily move to
component-helpers where it will be used by other components as well.
2021-02-01 10:48:38 -05:00
JunYang
f241036d2b
fix mistake about [avaliable] for index_test.go
...
Signed-off-by: JunYang <yang.jun22@zte.com.cn>
2021-01-20 08:37:50 +08:00
Shihang Zhang
d2859cd89b
plumb service account token down to csi driver
2020-11-12 09:26:43 -08:00
Kubernetes Prow Robot
423f8731ef
Merge pull request #95719 from tsmetana/add-pv_collector-provisioner-metric
...
PV Controller: Add plugin name and volume mode to PV metrics
2020-11-11 01:49:49 -08:00
Kubernetes Prow Robot
096819c963
Merge pull request #95909 from pohly/pv-controller-delete-pv-fix
...
PV controller: don't delete PVs when PVC is not known yet
2020-11-02 02:00:52 -08:00
Patrick Ohly
24f5764787
pv controller test: more test cases
...
The main goal was to cover retrieval of a PVC from the apiserver when
it isn't known yet. This is achieved by adding PVCs and (for the sake
of completeness) PVs to the reactor, but not the controller, when a
special annotation is set. The approach with a special annotation was
chosen because it doesn't affect other tests.
The other test cases were added while checking the existing tests
because (at least at first glance) the situations seemed to be not
covered.
2020-10-28 10:52:11 +01:00
Patrick Ohly
22f81e9e0b
pv controller test: use sub tests
...
This makes it possible to run individual tests.
2020-10-28 10:39:59 +01:00
Patrick Ohly
06f934ea1f
pv controller test: enable klog output
...
This makes it possible to run tests with -v=5 and thus actually get
some output.
2020-10-28 10:39:10 +01:00
Patrick Ohly
5686664a1d
PV controller: don't delete PVs when PVC is not known yet
...
Normally, the PV controller knows about the PVC that triggers the
creation of a PV before it sees the PV, because the PV controller must
set the volume.beta.kubernetes.io/storage-provisioner annotation that
tells an external provisioner to create the PV.
When restarting, the PV controller first syncs its caches, so that
case is also covered.
However, the creator of a PVC might decided to set that annotation
itself to speed up volume creation. While unusual, it's not forbidden
and thus part of the external Kubernetes API. Whether it makes sense
depends on the intentions of the user.
When that is done and there is heavy load, an external provisioner
might see the PVC and create a PV before the PV controller sees the
PVC. If the PV controller then encounters the PV before the PVC, it
incorrectly concludes that the PV needs to be deleted instead of being
bound.
The same issue occurred earlier for external binding and the existing
code for looking up a PVC in the cache or in the apiserver solves the
issue also for volume provisioning, it just needs to be enabled also
for PVs without the pv.kubernetes.io/bound-by-controller annotation.
2020-10-27 11:26:58 +01:00
Tomas Smetana
0c4e05a245
PV Controller: PV plugin and mode metrics
2020-10-23 14:35:35 +02:00
Kubernetes Prow Robot
dd466bccde
Merge pull request #94527 from brahmaroutu/mount-utils-2
...
Change code to use staging/k8s.io/mount-utils
2020-09-21 17:46:47 -07:00
Matthew Cary
f2e23afcf1
Adds filtering of hosts to DialContexts.
...
The provided DialContext wraps existing clients' DialContext in an attempt to
preserve any existing timeout configuration. In some cases, we may replace
infinite timeouts with golang defaults.
- scaleio: tcp connect/keepalive values changed from 0/15 to 30/30
- storageos: no change
2020-09-18 00:07:32 +00:00
Srini Brahmaroutu
fbe5daed73
Change code to use staging/k8s.io/mount-utils
2020-09-16 21:51:24 -07:00
knight42
e89e72b637
test: ensure WaitForCacheSync is called after starting sharedInformerFacotry
...
Signed-off-by: knight42 <anonymousknight96@gmail.com>
2020-09-15 16:02:35 +08:00
Kubernetes Prow Robot
5ce93a2ab5
Merge pull request #93673 from zhouya0/pv_controller_test_add_time_out
...
Cleanup wait forever loops in pv_controller_test.go
2020-08-28 08:04:17 -07:00
zhouya0
8724a8ea6b
Cleanup wait forever loops in pv_controller_test.go
2020-08-04 16:19:32 +08:00
Jordan Liggitt
c4c946d35d
Deflake TestControllerSync
2020-08-03 11:56:14 -04:00
Patrick Ohly
ff3e5e06a7
GenericEphemeralVolume: initial implementation
...
The implementation consists of
- identifying all places where VolumeSource.PersistentVolumeClaim has
a special meaning and then ensuring that the same code path is taken
for an ephemeral volume, with the ownership check
- adding a controller that produces the PVCs for each embedded
VolumeSource.EphemeralVolume
- relaxing the PVC protection controller such that it removes
the finalizer already before the pod is deleted (only
if the GenericEphemeralVolume feature is enabled): this is
needed to break a cycle where foreground deletion of the pod
blocks on removing the PVC, which waits for deletion of the pod
The controller was derived from the endpointslices controller.
2020-07-09 23:29:24 +02:00
Kobayashi Daisuke
4ae11dac2e
Replace StartLogging(klog.Infof) with StartStructuredLogging(0)
2020-06-15 17:48:35 +09:00
Yecheng Fu
8422044f17
sharing a common pod pvc indexer among volume controllers
2020-06-03 14:51:21 +08:00
Yecheng Fu
eaf2f54bba
auto-generated files
2020-06-03 14:51:21 +08:00
Yecheng Fu
32df4300ef
emit correct event when unbound delay binding claim is used by pod
2020-05-29 19:36:13 +08:00
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
...
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
...
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Jayasekhar Konduru
5a4f1be19d
Added events for failures in PV/PVC processing:
...
- PV has a dangling reference to a PVC
- PVC is trying to bind to a PV that already references a different PVC
Change-Id: Ic509d39808763149b02b4dd52347edb74a8803fd
2020-04-16 22:11:02 -07:00
Mike Danese
c58e69ec79
automated refactor
2020-03-05 14:59:46 -08:00
Jan Safranek
3af671011a
Generated API
2020-03-02 22:21:42 +01:00
Jan Safranek
2c1b743766
Promote block volume features to GA
2020-02-28 20:48:38 +01:00
Kubernetes Prow Robot
55f2d91c8c
Merge pull request #88447 from taesunny/pkg/controller
...
Fix pkg/controller typos in some error messages, comments etc
2020-02-26 19:39:19 -08:00
taesun_lee
79680b5d9b
Fix pkg/controller typos in some error messages, comments etc
...
- applied review results by LuisSanchez
- Co-Authored-By: Luis Sanchez <sanchezl@redhat.com>
genernal -> general
iniital -> initial
initalObjects -> initialObjects
intentionaly -> intentionally
inforer -> informer
anotother -> another
triger -> trigger
mutli -> multi
Verifyies -> Verifies
valume -> volume
unexpect -> unexpected
unfulfiled -> unfulfilled
implenets -> implements
assignement -> assignment
expectataions -> expectations
nexpected -> unexpected
boundSatsified -> boundSatisfied
externel -> external
calcuates -> calculates
workes -> workers
unitialized -> uninitialized
afater -> after
Espected -> Expected
nodeMontiorGracePeriod -> NodeMonitorGracePeriod
estimateGrracefulTermination -> estimateGracefulTermination
secondrary -> secondary
ShouldRunDaemonPodOnUnscheduableNode -> ShouldRunDaemonPodOnUnschedulableNode
rrror -> error
expectatitons -> expectations
foud -> found
epackage -> package
succesfulJobs -> successfulJobs
namesapce -> namespace
ConfigMapResynce -> ConfigMapResync
2020-02-27 00:15:33 +09:00
Maciej Borsz
7d59ea8394
Reorder conditions in FindMatchingVolume to avoid checking NodeAffinity
...
in trivial cases.
2020-02-26 09:20:38 +01:00
Hemant Kumar
d9f7a1f311
Don't call delete for already deleted volumes
2020-02-18 15:59:47 -05:00
David Zhu
81668cb887
Change migrated-to annoation key to follow best practices by removing beta and using 'pv' prefix
2020-02-12 10:33:08 -08:00
Mike Danese
25651408ae
generated: run refactor
2020-02-08 12:30:21 -05:00
Mike Danese
3aa59f7f30
generated: run refactor
2020-02-07 18:16:47 -08:00
David Zhu
b7817a2981
Add annotation annealing for migration for PVs and PVCs during syncVolume and syncClaim. This allows external-provisioners to pick up and delete volumes when they have been rolled up from previous kubernetes versions.
2020-01-27 16:14:53 -08:00
danielqsj
5bc0e26c19
unify alias of api errors under pkg and staging
2019-12-26 16:42:28 +08:00
Jordan Liggitt
5d5b444c4d
Remove use of testapi codecs, selflink, resourcepath functions
2019-12-13 11:56:29 -05:00
Travis Rhoden
0c5c3d8bb9
Remove pkg/util/mount (moved out of tree)
...
This patch removes pkg/util/mount completely, and replaces it with the
mount package now located at k8s.io/utils/mount. The code found at
k8s.io/utils/mount was moved there from pkg/util/mount, so the code is
identical, just no longer in-tree to k/k.
2019-11-15 08:29:12 -07:00
Kubernetes Prow Robot
372ebd24f5
Merge pull request #83098 from ddebroy/disable-intree
...
CSI Migration phase 2: disable probing of in-tree plugins
2019-11-14 20:51:42 -08:00
Deep Debroy
129f15328b
Disable in-tree plugins migrated to CSI
...
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2019-11-14 17:28:21 -08:00
Travis Rhoden
367f879131
Retire mount.Exec for k8s.io/utils/exec
...
This patch removes mount.Exec entirely and instead uses the common
utility from k8s.io/utils/exec.
The fake exec implementation found in k8s.io/utils/exec differs a bit
than mount.Exec, with the ability to pre-script expected calls to
Command.CombinedOutput(), so tests that previously relied on a callback
mechanism to produce specific output have been updated to use that
mechanism.
2019-11-13 14:09:57 -07:00
Kubernetes Prow Robot
d366d2eaa3
Merge pull request #84896 from RainbowMango/pr_migrate_custom_collector_scheduler
...
Migrate custom collector for kube-scheduler
2019-11-08 01:04:14 -08:00
Kubernetes Prow Robot
1183771545
Merge pull request #84748 from hvaara/fix-golint-controller-volume-persistentvolume-options
...
Fix golint issues in pkg/controller/volume/persistentvolume/options
2019-11-07 04:35:53 -08:00
RainbowMango
09dc221d7b
Deal with auto-generated files.
...
Update bazel by hack/update-bazel.sh
2019-11-07 10:30:12 +08:00
RainbowMango
9efabe8124
Migrate custom collector to stablility framework
2019-11-07 10:26:27 +08:00
yuxiaobo
81e9f21f83
Correct spelling mistakes
...
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-11-06 20:25:19 +08:00
Roy Hvaara
dffcf7c8cd
Fix golint issues in pkg/controller/volume/persistentvolume/options
2019-11-04 21:45:21 +01:00
wojtekt
7b6bcdf780
Autogenerated code
2019-10-24 20:21:00 +02:00
Jan Safranek
a689697519
Do not bind block PV/PVCs when block feature gate is off
2019-10-17 12:40:22 +02:00
Ted Yu
56717a79ff
Log the error return from store.Delete
2019-10-05 19:34:39 -07:00
Kubernetes Prow Robot
14e5adfc85
Merge pull request #82683 from davidz627/fix/translationStruct
...
Refactor CSI Translation Library into a struct that is injected into various components to simplify unit testing
2019-09-29 10:11:37 -07:00
David Zhu
92cb06a2e7
Refactor CSI Translation Library into a struct that is injected into various components to simplify unit testing in future
2019-09-27 12:59:53 -07:00
Kubernetes Prow Robot
11ce7da888
Merge pull request #82740 from hwdef/del-unuse-var1
...
del unuse var in pkg/controller
2019-09-19 11:05:15 -07:00
Shintaro Murakami
ad333ac421
Return error when failed to get storage class
2019-09-18 15:59:34 +09:00
hwdef
851eac6a97
del unuse var in pkg/controller
2019-09-16 15:05:24 +08:00
Kubernetes Prow Robot
cedffee93e
Merge pull request #82239 from sttts/sttts-persistentvolume-controller-data-race
...
persistentvolume-controller: fix data race of non-deepcopied objects in fake client
2019-09-03 14:35:12 -07:00
Dr. Stefan Schimanski
7816ad7991
persistentvolume-controller: fix data race of non-deepcopied objects in fake client
2019-09-02 15:23:55 +02:00
Han Kang
59db3ac27e
migrate controller-manager metrics to stability framework
2019-08-28 12:26:57 -07:00
Kubernetes Prow Robot
927f45191e
Merge pull request #81527 from yastij/move-controller-util
...
move WaitForCacheSync to the sharedInformer package
2019-08-27 00:52:54 -07:00
Yassine TIJANI
7e4c3096fe
move WaitForCacheSync to the sharedInformer package
...
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>
2019-08-22 16:13:41 +01:00
Sadlil Rhythom
7a8eaf4561
controller:volume fix static check failures
2019-08-21 09:37:42 +02:00
czm
cdcf1c0ea2
fix some typos in recycle_test.go
2019-08-15 11:34:46 +08:00
AllenZMC
d266b79a39
fix some typos in testing.go
2019-08-14 20:53:24 +08:00
Travis Rhoden
4574473753
Rename mount.NewOsExec to mount.NewOSExec
2019-08-09 12:30:56 -06:00
Yi Tang
8c13f9dea3
fix pv controller not find pv for pvc provisioning
2019-07-26 16:24:30 +08:00
AllenZMC
852040c036
fix typos in pv_controller.go
...
make code kinda more readable
2019-07-25 11:28:19 +08:00