Commit Graph

211 Commits

Author SHA1 Message Date
杨军10092085
361e4ff0fa volume: use contextual logging 2023-03-14 08:37:30 +08:00
Jan Safranek
fc245b339b Refactor ConstructVolumeSpec
Return a struct from ConstructVolumeSpec to be able to add more fields to
it later.
2022-11-03 16:55:13 +01:00
Jan Safranek
cdb3ead5a9 Add SupportsSELinuxContextMount
Add a new call to VolumePlugin interface and change all its
implementations.

Kubelet's VolumeManager will be interested whether a volume supports
mounting with -o conext=XYZ or not to hanle SetUp() / MountDevice()
accordingly.
2022-08-04 10:51:28 +02:00
Kubernetes Prow Robot
b167260436
Merge pull request #110399 from claudiubelu/unittests-2
unittests: Fixes unit tests for Windows (part 2)
2022-08-01 15:04:29 -07:00
Claudiu Belu
38092cb458 unittests: Fixes unit tests for Windows (part 2)
Currently, there are some unit tests that are failing on Windows due to
various reasons:

- volume mounting is a bit different on Windows: Mount will create the
  parent dirs and mklink at the volume path later (otherwise mklink will
  raise an error).
- os.Chmod is not working as intended on Windows.
- path.Dir() will always return "." on Windows, and filepath.Dir()
  should be used instead (which works correctly).
- on Windows, you can't typically run binaries without extensions. If
  the file C:\\foo.bat exists, we can still run C:\\foo because Windows
  will append one of the supported file extensions ($env:PATHEXT) to it
  and run it.
- Windows file permissions do not work the same way as the Linux ones.
- /tmp directory being used, which might not exist on Windows. Instead,
  the OS-specific Temp directory should be used.

Fixes a few other issues:

- rbd.go: Return error in a case in which an error is encountered. This
  will prevent "rbd: failed to setup" and "rbd: successfully setup" log
  messages to be logged at the same time.
2022-08-01 18:56:32 +03:00
Claudiu Belu
7e6e31577e unittests: Adds Windows unittests
Adds unit tests for a few functions that are not covered.
2022-07-08 17:24:15 +03:00
Jiawei Wang
760365d5c9 CSIMigration feature gate to GA 2022-06-06 21:19:19 +00:00
Kubernetes Prow Robot
06e107081e
Merge pull request #104732 from mengjiao-liu/remove-flag-experimental-check-node-capabilities-before-mount
kubelet: Remove the deprecated flag `--experimental-check-node-capabilities-before-mount`
2022-02-24 07:56:30 -08:00
Jan Safranek
525b8e5cd6 Rename SupportsSELinux to SELinuxRelabel
The field in fact says that the container runtime should relabel a volume
when running a container with it, it does not say that the volume supports
SELinux. For example, NFS can support SELinux, but we don't want NFS
volumes relabeled, because they can be shared among several Pods.
2022-02-16 10:54:08 +01:00
Davanum Srinivas
9682b7248f
OWNERS cleanup - Jan 2021 Week 1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-01-10 08:14:29 -05:00
Mengjiao Liu
beda4cafb6 kubelet: Remove the deprecated flag --experimental-check-node-capabilities-before-mount 2022-01-06 11:47:11 +08:00
Davanum Srinivas
497e9c1971
Cleanup OWNERS files (No Activity in the last year)
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-15 10:34:02 -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
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
Cheng Xing
0e315355df Pass FsGroup to MountDevice 2021-07-03 16:29:42 -07: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
Divyen Patel
518844fd25 use GA topology labels for vsphere 2021-06-21 10:37:31 -07:00
Kubernetes Prow Robot
f7e62dc5bb
Merge pull request #100746 from mengjiao-liu/fix-nil-call
Fixed a possible nil pointer dereference caused by variable `plug`
2021-05-26 14:49:38 -07:00
mengjiao.liu
c24b87b133 Fixed a possible nil pointer dereference caused by variable plug 2021-05-21 10:17:04 +08:00
Niels de Vos
b997e0e4d6 Add SupportsMetrics() for Block-mode volumes
Volumes that are provisioned with `VolumeMode: Block` often have a
MetrucsProvider interface declared in their type. However, the
MetricsProvider should implement a GetMetrics() function. In the cases
where the storage drivers do not implement GetMetrics(), a panic can
occur.

Usual type-assertions are not sufficient in this case. All assertions
assume the interface is present. There is no straight forward way to
verify that a valid GetMetrics() function is provided.

By adding SupportsMetrics(), storage driver implementations require
careful reviewing for metrics support.
2021-05-20 17:10:23 +02:00
Niels de Vos
e7dedc5cd1 Support Capacity metric for block PVCs for in-tree drivers
PR #97972 added support for gathering metrics for Block PVCs provided by
CSI drivers. The in-tree drivers can support at leas the most basic
metric; Capacity.
2021-05-20 16:37:12 +02:00
wangyx1992
7fe934a72d cleanup: fix log capitalization in volume package
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
2021-04-14 21:58:56 +08:00
Kubernetes Prow Robot
3c20c5aa2f
Merge pull request #100177 from wangyx1992/wrapped-error
fix errors in wrapped format
2021-04-13 23:24:42 -07:00
Kubernetes Prow Robot
4959cd6339
Merge pull request #100671 from Niekvdplas/spelling-mistakes
Fixed several spelling mistakes
2021-04-09 05:19:45 -07:00
Kubernetes Prow Robot
67820edf18
Merge pull request #100404 from gnufied/reduce-vsphere-volume-length
reduce volume length for vsphere volumes
2021-04-08 22:08:49 -07:00
Niekvdplas
fec272a7b2 Fixed several spelling mistakes 2021-03-30 23:02:09 +02:00
wangyx1992
34c2b2360b fix errors in wrapped format
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
2021-03-26 14:57:55 +08:00
Hemant Kumar
0c9138a204 reduce volume length for vsphere volumes further 2021-03-23 13:43:51 -04:00
lala123912
127b675a15 Remove unused/dead code 2021-03-09 09:34:37 +08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Divyen Patel
3e91ac26fb deprecating in-tree vsphere volume diskformat sc parameter, vSphere less than 67u3, vm hardware less than 15 and multi vCenter server 2021-02-19 16:30:49 -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
Kubernetes Prow Robot
984bc043d5
Merge pull request #96593 from pandaamanda/typo_fix
fix typo and format for klog
2020-12-08 17:29:43 -08:00
Kubernetes Prow Robot
160c33a6a1
Merge pull request #96533 from gnufied/reduce-vsphere-volume-name
Reduce volume name length for vsphere
2020-11-17 17:34:05 -08:00
Hemant Kumar
742436c431 Reduce volume name length for vsphere 2020-11-16 11:28:26 -05:00
xiongzhongliang
0d2b542dde fix typo and format for klog 2020-11-14 23:44:38 +08:00
Shihang Zhang
d2859cd89b plumb service account token down to csi driver 2020-11-12 09:26:43 -08:00
Kubernetes Prow Robot
734889ed82
Merge pull request #96224 from gnufied/add-dangling-error-vsphere
Add dangling volume check for vsphere
2020-11-09 16:09:09 -08:00
Hemant Kumar
6c4c5ab691 Add dangling volume check for vsphere 2020-11-09 15:39:17 -05:00
Tim Hockin
819ff9b087
Use topology labels instead of old beta names (#96033)
* Rename const for topology.../zone

* Rename const for topology.../region

* Rename const for failure-domain.../zone

* Rename const for failure-domain.../region

* Restore old names for compat
2020-11-05 20:26:50 -08:00
jornshen
db53ca01da change plugin name in fsgroupapplymetrics of csi and flexvolume to
distinguish different driver
2020-11-04 16:28:28 +08:00
jornshen
4ed7709774 Report a metric for time taken to perform recursive permission change 2020-10-26 21:04:30 +08:00
Kubernetes Prow Robot
e799c852fb
Merge pull request #95447 from gnufied/fix-disk-detach-failure
Fix vsphere disk detach failure
2020-10-13 03:36:41 -07:00
tashen
27cb5cf4f0 add systemd mount options interface to support the no-systemd mount 2020-10-13 13:46:57 +08:00
Hemant Kumar
5627771601 Fix vsphere disk detach failing
Make inability to fetch canonicalPath non-fatal error
Throw error if we can't fetch canonicalPath on attach
2020-10-12 21:58:28 -04:00
Srini Brahmaroutu
fbe5daed73 Change code to use staging/k8s.io/mount-utils 2020-09-16 21:51:24 -07:00
Nikhita Raghunath
53e87ddd15 vsphere: remove inactive members from OWNERS
As a part of cleaning up inactive members (who haven't been active since
beginning of 2019) from OWNERS files, this commit moves abrarshivani to
emeritus_approvers section.
2020-08-10 15:23:25 +05:30
haleygo
a5b7ce1bfd fix static check failed from pkg/volume/vspherevolume
remove field from staticcheck_failures
2020-06-27 02:03:13 +08:00
Divyen Patel
148ef06a3d vSphere in-tree volumes migration to vSphere CSI driver 2020-06-08 16:17:02 -07: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