Commit Graph

172 Commits

Author SHA1 Message Date
杨军10092085
361e4ff0fa volume: use contextual logging 2023-03-14 08:37:30 +08:00
Stephen Kitt
56d8302bc8
Use k8s utils pointer instead of Azure autorest/to
Since k/u includes pointer functions which are equivalent to the
autorest/to pointer functions, and the latter are deprecated, it seems
useful to switch to the former:
* to.FooPtr becomes pointer.Foo
* to.Foo becomes pointer.FooDeref with an appropriate default
* to.StringSlicePtr becomes &

This doesn't remove anything from vendor, but it does turn the
dependency into an indirect one, ready to be removed when the rest of
the Azure migration happens.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2022-12-07 18:16:16 +01: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
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
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
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
mengjiao.liu
c24b87b133 Fixed a possible nil pointer dereference caused by variable plug 2021-05-21 10:17:04 +08: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
a55bd63172
Merge pull request #100731 from kassarl/azurefile-InvalidCharacter-issue
Normalize share name to not include capital letters
2021-04-09 05:20:58 -07:00
Laila Kassar
a5fdad260f
Update pkg/volume/azure_file/azure_provision.go
Co-authored-by: Shiming Zhang <wzshiming@foxmail.com>
2021-03-31 22:54:21 -05:00
Laila Kassar
7514ad4467 Normalize share name to not include capital letters 2021-03-31 23:52:36 +00:00
Michelle Au
9c169a2122 Revert "fix azure file secret not found issue"
This reverts commit 8d43976b74.

Change-Id: Iefaa0e76489883830ba1c9bdcbc3101bcc33082c
2021-03-25 09:28:50 -07:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Christian Huffman
8d804287d3 Updates the Azure File minimum size for premium accounts 2021-02-16 10:57:41 -05:00
Kubernetes Prow Robot
0f7c2dc314
Merge pull request #97082 from andyzhangx/azurefile-actimeo
fix: azure file latency issue for metadata-heavy workloads
2020-12-21 19:12:25 -08:00
andyzhangx
8d43976b74 fix azure file secret not found issue 2020-12-21 11:17:40 +00:00
andyzhangx
ff110654e9 fix: azure file latency issue for metadata-heavy workload 2020-12-05 12:42:56 +00:00
Shihang Zhang
d2859cd89b plumb service account token down to csi driver 2020-11-12 09:26:43 -08:00
tashen
27cb5cf4f0 add systemd mount options interface to support the no-systemd mount 2020-10-13 13:46:57 +08:00
Srini Brahmaroutu
fbe5daed73 Change code to use staging/k8s.io/mount-utils 2020-09-16 21:51:24 -07:00
andyzhangx
1b213c9053 fix: use sensitiveOptions on Windows mount 2020-08-20 07:31:07 +00:00
andyzhangx
82b8b07a2d fix: initial delay in mounting azure disk/file 2020-07-14 07:14:43 +00:00
ZeroMagic
7e7cf6a314 add tags support for azure file driver
Signed-off-by: ZeroMagic <jiliu8@microsoft.com>
2020-07-09 03:47:24 +00:00
andyzhangx
42e378f86f chore: add azure file protocol parameter
fix typo

fix e2e test failure

fix comments
2020-06-21 03:36:01 +00: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
75fdb6d554 When casting resource.Quantity to int64 it may overflow
We need to ensure that when converting resource.Quantity
to int64 it does not overflow and if it does, then an error is
returned back to the use rather than attempting expansion and
provisioning operations with scaled value.
2020-05-13 21:22:59 -04:00
ZeroMagic
01713f2411 chore: set resourceGroup into azure pv annotation
Signed-off-by: ZeroMagic <jiliu8@microsoft.com>
2020-05-12 05:34:27 +00:00
ZeroMagic
f3a64e22d9 chore: switch to use AzureFile management SDK
Signed-off-by: ZeroMagic <jiliu8@microsoft.com>
2020-05-09 02:52:51 +00:00
saad-ali
548b297a00 Prevent AzureFile from logging senstive options 2020-03-03 11:20:08 -08:00
andyzhangx
fb7209486e fix: azure file mount timeout issue 2020-02-27 09:29:27 +00:00
Kubernetes Prow Robot
3e3a3599ca
Merge pull request #87711 from alena1108/jan30volume
Ineffassign fixes for pkg/volume
2020-02-14 21:53:28 -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
Alena Prokharchyk
331cd94ccc Ineffassign fixes for pkg/volume
Along resolves errors whitelisted in hack/.staticcheck_failures
2020-01-31 10:14:45 -08:00
Kubernetes Prow Robot
97e34ee223
Merge pull request #85475 from andyzhangx/upgrade-azure-storage-lib
upgrade api-version to fix azure file AuthorizationFailure
2019-12-02 17:07:10 -08:00
andyzhangx
6b73c9f8c2 upgrade api-version to fix azure file AuthorizationFailure
fix build failure
2019-11-20 05:41:25 +00:00
David Zhu
21f7060c8f Plumb test state through to fake volume host creation for error handling 2019-11-18 14:45:01 -08: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
1fd8921546
Move mount/fake.go to mount/fake_mount.go
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.
2019-11-08 08:07:41 -07:00
David Eads
7d897d5f77 make azure fail if feature gates are not registered 2019-11-07 12:42:09 -05:00