Commit Graph

81 Commits

Author SHA1 Message Date
Tero Saarni
96306f144a Set permissions on volume before publishing update
This change fixes a race condition that was caused by setting the file owner,
group and mode non-atomically, after the updated files had been published.

Users who were running non-root containers, without GID 0 permissions, and
had removed read permissions from other users by setting defaultMode: 0440 or
similar, were getting intermittent permission denied errors when accessing
files on secret or configmap volumes or service account tokens on projected
volumes during update.
2022-12-24 07:59:41 +02: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
PingWang
1061c4f6d0 Handle os.MkdirAll error
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2022-06-30 16:26:24 +08: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
Mengjiao Liu
beda4cafb6 kubelet: Remove the deprecated flag --experimental-check-node-capabilities-before-mount 2022-01-06 11:47:11 +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
Shihang Zhang
d2859cd89b plumb service account token down to csi driver 2020-11-12 09:26:43 -08:00
Marek Siarkowicz
973218b17d Add datapolicy tags to pkg/volume/ 2020-10-30 15:51:36 +01:00
Srini Brahmaroutu
fbe5daed73 Change code to use staging/k8s.io/mount-utils 2020-09-16 21:51:24 -07: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
saad-ali
3784438b56 Prevent CephFS from logging senstive options 2020-03-03 11:20:08 -08:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -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
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
choury
edc21ac27b Use Join instead of concat it manually in cephfs. 2019-07-01 20:09:43 +08:00
Robert Krawitz
5b97b2860d Change fsGroup to mounterArgs in volume.SetUp() to allow for future extension. 2019-05-29 15:12:28 -04:00
Travis Rhoden
78d109e201 Always use filepath.Join instead of path.Join
This patch cleans up pkg/util/mount/* and pkg/util/volume/* to always
use filepath.Join instead of path.Join. filepath.Join is preferred
because path.Join can have issues on Windows.
2019-04-29 09:56:05 -06:00
danielqsj
657a1a1a34 change import alias of utils/strings 2019-01-30 10:44:09 +08:00
danielqsj
093328e57f migrate to k8s.io/utils/strings 2019-01-30 10:24:00 +08:00
Kubernetes Prow Robot
cc1be28943
Merge pull request #72624 from danielqsj/clean_unmount
Cleanup callers of deprecated functions in volume/util
2019-01-28 23:06:20 -08:00
David Zhu
d8c9dc5bb5 Add IsMigratableToCSI to volume plugin interface 2019-01-17 14:43:52 -08:00
danielqsj
d94cd822b7 Cleanup UnmountPath/UnmountMountPoint callers 2019-01-08 22:13:50 +08:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
yameiwang
18a904d187 fix golint errors in pkg/volume/* 2018-11-01 16:52:56 +08:00
mlmhl
12e007d33c improve cephfs fuse error log level 2018-10-30 09:56:47 +08:00
Kenjiro Nakayama
32117163e4 Support mount options for cephfs with ceph-fuse mount
When cephfs uses ceph-fuse for the mount command, mount option and
readOnly options are disregarded. This patch adds to ceph-fuse as
well.
2018-08-13 18:09:28 +09:00
zhangxiaoyu-zidif
65b8f7027b fix cephfs fuse mount bug when use is not admin 2018-03-28 09:20:32 +08:00
wackxu
f737ad62ed update import 2018-02-27 20:23:35 +08:00
jianglingxia
2d805c727e correct the ConstructVolumeSpec func path value 2018-02-09 17:29:24 +08:00
jianglingxia
763fd53adf make sure mounter not nil and fix some typo 2018-02-06 18:28:07 +08:00
Kubernetes Submit Queue
6b925ac24b
Merge pull request #56851 from zouyee/ceph-1
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

check function return err

**What this PR does / why we need it**:
check function return err

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```NONE

```
2018-01-10 03:12:28 -08:00
zhangxiaoyu-zidif
ec6b9eb956 fix-binary-check-cephfs 2018-01-04 11:08:40 +08:00
zouyee
b6e1fecde7 check function return err 2017-12-19 23:24:35 +08:00
Kubernetes Submit Queue
69b9007667
Merge pull request #55866 from zhangxiaoyu-zidif/make-k8s-support-ceph-fuse
Automatic merge from submit-queue (batch tested with PRs 55954, 56037, 55866, 55984, 54994). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

make k8s support cephfs fuse mount

**What this PR does / why we need it**:
make  k8s support cephfs fuse.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes https://github.com/kubernetes/kubernetes/issues/46636, https://github.com/kubernetes/kubernetes/issues/44486

**Special notes for your reviewer**:

**Release note**:

```release-note
K8s supports cephfs fuse mount.
```
2017-12-13 23:25:56 -08:00
supereagle
032416c75d use core client with explicit version
fix more usage of deprecated core client
2017-11-25 08:14:10 +08:00
zhangxiaoyu-zidif
0ee152a616 make k8s support cephfs fuse mount 2017-11-21 01:44:09 +08:00
Huamin Chen
9e65623187 refactor CephFS PV spec to use SecretReference
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-08-24 18:49:05 +00:00
Kubernetes Submit Queue
43fd8eebf0 Merge pull request #49922 from riverzhang/volume-cephfs
Automatic merge from submit-queue (batch tested with PRs 50806, 48789, 49922, 49935, 50438)

Fix Getpath() description

Modify the description of the word error



**What this PR does / why we need it**:

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-08-22 19:45:32 -07:00
riverzhang
b35df24cbc fix some typo 2017-08-15 04:19:01 -05:00
riverzhang
d9c9d1bbdc fix some typo 2017-08-15 04:16:20 -05:00
Jan Safranek
bc0e170d9c Add pluginName to VolumeHost.GetMouter
Different plugins can get different mounter, depending where the mount
utilities are.
2017-08-14 12:16:26 +02:00
rong.zhang
e018887501 Fix Getpath() description
Modify the description of the word error
2017-08-02 09:39:07 +08:00
Kubernetes Submit Queue
62b801ef91 Merge pull request #47241 from NickrenREN/cephfs-loglevel
Automatic merge from submit-queue (batch tested with PRs 47922, 47195, 47241, 47095, 47401)

Change cephfs secret related logs level

Fixes: #45387
**Release note**:

```release-note
NONE
```

/cc @rootfs
2017-06-22 21:33:29 -07:00
Chao Xu
60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu
f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
mbohlool
c91a12d205 Remove all references to types.UnixUserID and types.UnixGroupID 2017-06-21 04:09:07 -07:00