Jan Safranek
260912490e
Add a coment about handling same volumes with different contexts
2022-08-04 10:51:56 +02:00
Jan Safranek
a01e720a1a
Rename IsRWOP
...
To be able to update content of the function to other access modes when we
implement SELinux mount for more of them.
2022-08-04 10:51:54 +02:00
Jan Safranek
1490d51028
Remove noisy log
...
The error would be logged every reconciler sync (100 ms).
2022-08-04 10:51:53 +02:00
Jan Safranek
0793ecee3a
Add unit tests for ASW.AddPodToVolume
2022-08-04 10:51:52 +02:00
Jan Safranek
17d850ee0e
Add interface for SELinuxOptionsToFileLabel
...
github.com/opencontainers/selinux/go-selinux needs OS that supports SELinux
and SELinux enabled in it to return useful data, therefore add an interface
in front of it, so we can mock its behavior in unit tests.
2022-08-04 10:51:51 +02:00
Jan Safranek
d9f792633d
Add AddPodToVolume unit tests with SELinux
2022-08-04 10:51:50 +02:00
Jan Safranek
8d6b721ddd
Extract SELinux context error handling into a common func
...
Add handlerSELinuxMetricError() which bumps the right metric + either
consumes a SELinux error or lets it propagate up the stack.
2022-08-04 10:51:48 +02:00
Jan Safranek
49148ddfd0
Extract getSELinuxLabel from AddPodToVolume
...
To keep the function smaller.
2022-08-04 10:51:46 +02:00
Jan Safranek
de7f5b66ed
Fix existing unit tests
2022-08-04 10:51:44 +02:00
Jan Safranek
b2e18c0b20
Add metrics for SELinux context mount
...
Add separate _errors and _warnings to capture volumes that were rejected
from those will be rejected when the feature is expanded to all access
mode.
2022-08-04 10:51:43 +02:00
Jan Safranek
48b0751269
Add SELinux context tracking to volume manager
...
Both ActualStateOfWorld and DesiredStateOfWorld must track SELinux context
of volume mounts.
2022-08-04 10:51:41 +02:00
Hemant Kumar
835e8ccc76
Use CheckAndMarkAsUncertainViaReconstruction for uncertain volumes
...
Also only remove volumes from skippedDuringReconstruction only if
volume was marked as attached.
2022-07-22 20:11:37 -04:00
Hemant Kumar
6d43345c06
Remove volume from found during reconstruction if mounted
...
Add unit tests for removing reconstructed volumes from ASOW
2022-07-22 20:04:51 -04:00
Hemant Kumar
eb071c2755
Fix code to process volumes which were skipped during reconstruction
2022-07-22 20:04:51 -04:00
Hemant Kumar
a99466ca86
check existing size before querying new size from api-server
2022-03-28 11:32:49 -04:00
Hemant Kumar
1809094389
address review comments for rwx volume types
2022-03-28 11:32:49 -04:00
Hemant Kumar
ed217f4140
rename SetVolumeSize to InitializeVolumeSize
2022-03-28 11:32:49 -04:00
Hemant Kumar
7a43406138
Do not update PVC if it already has updated size
2022-03-28 11:32:49 -04:00
Hemant Kumar
c0fbd83cde
Fix code for desired state of the world populator
2022-03-28 11:32:49 -04:00
Hemant Kumar
e4f62d6c41
Modify code to use new interface functions
2022-03-28 11:32:49 -04:00
Hemant Kumar
2e54686f1b
Add a function to record volume size in dsow
2022-03-28 11:32:49 -04:00
Hemant Kumar
10f91a9951
Refactor volume attach code
2022-03-28 11:32:49 -04:00
Hemant Kumar
6eea80ec97
Record size of volume in desired and actual state of the world
2022-03-28 11:32:49 -04:00
Hemant Kumar
cdfb841a52
remove ExpandInUsePersistentVolume feature gate
2022-03-24 11:19:42 -04:00
Hemant Kumar
55b5e6dc33
Add metric for reporting total end-to-end mount time
...
This metric includes time spent in waiting for devices to be attached,
any RPC calls and performing recursive chown etc.
2021-12-13 16:23:01 -05:00
KeZhang
65618bfd69
Add sync reconstructed volume from desired state of world for volumemanager
2021-07-13 12:51:37 +08:00
Chris Henzie
2b98f8edc7
Enforce ReadWriteOncePod access mode during mount
2021-06-28 21:25:37 -07:00
Jan Safranek
d3dfe124da
Update mounter interface in volume manager
...
Update mounter interface in volume manager's ActualStateOfWorld every time.
Otherwise kubelet uses the first mounter it gets, which may not have the
latest information.
This fixes set up of CSI volumes, which store information about SELinux
support in their `mounter` interface implementation. With each MountVolume()
retry, a new mounter is instantiated and only the final mounter that succeeds
has the right info if the volume supports SELinux or not and can later
return the right attributes on GetAttributes() call.
2021-06-24 14:11:31 +02:00
Jan Safranek
2fcb5e9cf7
Add PodRemovedFromVolume
...
To know when a volume has been fully unmounted (incl. uncertain mounts).
2021-06-16 18:41:41 +02:00
Jan Safranek
ca934b8f5c
Add GetPossiblyMountedVolumesForPod to let kubelet know all volumes were unmounted
...
podVolumesExist() should consider also uncertain volumes (where kubelet
does not know if a volume was fully unmounted) when checking for pod's
volumes. Added GetPossiblyMountedVolumesForPod for that.
Adding uncertain mounts to GetMountedVolumesForPod would potentially break
other callers (e.g. `verifyVolumesMountedFunc`).
2021-06-16 18:39:12 +02:00
JunYang
01a4e4face
Structured Logging migration: modify volume and container part logs of kubelet.
...
Signed-off-by: JunYang <yang.jun22@zte.com.cn>
2021-03-17 08:59:03 +08:00
Benjamin Elder
56e092e382
hack/update-bazel.sh
2021-02-28 15:17:29 -08:00
Chris Henzie
9d8f994d4e
Separate test Kubelet and AttachDetach VolumeHost types
...
fakeVolumeHost previously implemented both the KubeletVolumeHost and
AttachDetachVolumeHost interfaces. This design makes it difficult to test the
CSIAttacher since it behaves differently depending on what type of
VolumeHost is supplied.
2020-12-17 15:17:04 -08:00
Shihang Zhang
d2859cd89b
plumb service account token down to csi driver
2020-11-12 09:26:43 -08:00
Jiawei Wang
a6d8e6c5c2
Detect change of volume attachability in the middle of attaching
...
- Add Unit tests for both volumemanager and attach/detach controller
- Add E2E test
2020-08-24 17:15:11 -07:00
Hemant Kumar
b8c0435bc2
Handle volume-in-use error
2020-07-11 09:02:58 -04:00
liuxu
2367569f13
fix if don't set ephemeral-storage limit emptyDir's sizeLimit doesn't work
2020-05-23 13:36:56 +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
Hemant Kumar
ca532c6fb2
Ensure that error is returned on NodePublish
2019-12-11 22:10:09 -05:00
Hemant Kumar
309c6f863a
Handle the case of remounts correctly
2019-12-02 12:09:38 -05:00
Hemant Kumar
5feea93163
Rename MarkVolumeMountedOpts to MarkVolumeOpts
...
Also remove VolumeNotMounted state
2019-12-02 12:09:38 -05:00
Hemant Kumar
cdbd3ba5c2
Change interface of SetUp function
2019-12-02 12:09:38 -05:00
Hemant Kumar
50dbcb3e00
Make sure PodExistsInVolume does not uses uncertain volumes
2019-12-02 12:01:40 -05:00
Hemant Kumar
34a6007dfe
Add code to mark volume as uncertain
...
Update bazel files
Add tests for volume mounts in uncertain state
2019-12-02 12:01:40 -05:00
Hemant Kumar
a795f3de88
Add code for introducing uncertain state of mounts
...
Add a comment about volumestate
2019-12-02 11:57:40 -05:00
David Zhu
21f7060c8f
Plumb test state through to fake volume host creation for error handling
2019-11-18 14:45:01 -08:00
sunxiaofei03
45d41ed9e5
replace iteration with hashmap in *state_of_world
2019-08-29 19:22:25 +08:00
Kubernetes Prow Robot
a3488b4cee
Merge pull request #81206 from tallclair/staticcheck-kubelet-push
...
Cleanup Kubelet static analysis issues
2019-08-22 15:09:43 -07:00
Tim Allclair
6510d26b6a
Fix misc static check issues
2019-08-21 10:40:21 -07:00