Commit Graph

252 Commits (af2659527f0bd2f7ad8500ffcd0e5640bfd53cc3)

Author SHA1 Message Date
andyzhangx 4b4b6cdcab fix race condition issue for smb mount on windows
change var name
2019-03-14 15:02:15 +00:00
andyzhangx 720a5e20d8 fix smb unmount issue on Windows
fix log warning

use IsCorruptedMnt in GetMountRefs on Windows

use errorno in IsCorruptedMnt check

fix comments: add more error code

add more error no checking

change year

fix comments
2019-03-10 02:13:16 +00:00
Kubernetes Prow Robot 59ee7353e8
Merge pull request #74625 from davidz627/fix/xfsUnmount
GetMountRefs fixed to handle corrupted mounts by treating it like an unmounted volume
2019-03-06 20:35:26 -08:00
David Zhu 5bf970f848 GetMountRefs fixed to handle corrupted mounts by treating it like an
unmounted volume
2019-03-06 14:34:16 -08:00
Travis Rhoden 2c4d748bed Refactor subpath out of pkg/util/mount
This patch moves subpath functionality out of pkg/util/mount and into a
new package pkg/volume/util/subpath. NSEnter funtionality is maintained.
2019-02-26 19:59:53 -07:00
Travis Rhoden 766cf26897 Move original mount files back
Move original mount files back into pkg/util/mount. This move is done to
preserve git history.
2019-02-26 12:18:25 -07:00
Travis Rhoden f2438cacf5 Copy mount files to pkg/volume/util/subpath
Files in pkg/util/mount that contain significant code implementation for
subpaths are moved to a new package at pkg/volume/util/subpath. This
move is done in order to preserve git history.
2019-02-26 12:14:55 -07:00
Clayton Coleman 7f01e23380
Ignore the sticky gid mode bit when a test is running on memory EmptyDir
While running unit tests for perf on a Kube cluster with a memory backed
emptydir as TMPDIR, TestSafeMakeDir failed with:

```
--- FAIL: TestSafeMakeDir (0.01s)
	mount_linux_test.go:661: test "directory-exists": expected permissions 20000000750, got 20020000750
```

(TMPDIR set to /tmp/volume, /tmp/volume is EmptyDir with type Memory)

The test doesn't actually care about `os.ModeSetgid`, so specifically mask it out when testing this way.
2019-02-24 17:30:37 -08:00
Kubernetes Prow Robot 9027738dd5
Merge pull request #73661 from andyzhangx/smb-mount-windows
fix smb remount issue on Windows
2019-02-15 14:04:59 -08:00
andyzhangx 660813c2d1 fix smb remount issue on Windows
add comments for doSMBMount func

fix comments about smb mount
2019-02-14 14:19:24 +00:00
Roy Lenferink b43c04452f Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
Kubernetes Prow Robot 4331660fcd
Merge pull request #73445 from danielqsj/fix-exec
migrate the rest reference of pkg/util/exec to k8s.io/utils/exec
2019-02-01 17:14:15 -08:00
Andrew Kim 84191eb99b replace pkg/util/file with k8s.io/utils/path 2019-01-29 15:20:13 -05:00
danielqsj c7a012f033 migrate the rest reference of pkg/util/exec to k8s.io/utils/exec 2019-01-29 10:55:10 +08:00
Andrew Kim 2ea82cea20 replace pkg/util/nsenter with k8s.io/utils/nsenter 2019-01-24 13:49:04 -05:00
Andrew Kim 123590d911 replace pkg/util/io with k8s.io/utils/io 2019-01-24 13:49:04 -05:00
Yecheng Fu 037ab98521 Deprecate mount.IsNotMountPoint 2019-01-06 20:25:31 +08:00
Michelle Au 7a4f906f25 Rename UnmountMountPoint to CleanupMountPoint 2019-01-03 16:35:54 -08:00
Michelle Au 1dacde1210 Move linux test utils to os-independent test file 2019-01-03 16:35:54 -08:00
Michelle Au f33d5d3b05 Add comments around use of PathExists 2019-01-03 16:34:53 -08:00
Michelle Au 57c7a200f0 Add unit test for UnmountMountPoint 2019-01-03 16:34:53 -08:00
Michelle Au 15d44a64e9 Update doCleanSubpaths to use UnmountMountPoint 2019-01-03 16:34:53 -08:00
Michelle Au 002a4e33d8 Move unmount volume util from pkg/volume/util to pkg/util/mount 2019-01-03 16:34:53 -08:00
Michelle Au 3ebbbbd5d8 Leave refactoring TODO 2018-12-26 10:49:28 -08:00
Jan Safranek cfbf6aa925 Fix unit test to run with random UID
User that runs the tests desn't need to be in /etc/passwd and thus
user.Current() can fail. Assume the user is not root in this case.
2018-11-19 13:08:54 +01: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
Jan Safranek 0b8c472578 Fixed subpath in containerized kubelet.
IsNotMountPoint should return no error when the checked directory does not
exists - missing directory can't be mounted. Therefore containerized
kubelet should check if the target exists first before resolving symlinks.
EvalHostSymlinks() returns indistinguishible error in case the path does
not exist.
2018-10-09 13:11:23 +02:00
k8s-ci-robot ecfd1a3e56
Merge pull request #68945 from gnufied/fix-mount-options
Make sure we pass mount options while creating bind mounts
2018-10-01 09:27:54 -07:00
k8s-ci-robot 29cff0d518
Merge pull request #68741 from jsafrane/fix-var-symlink
Fixed subpath cleanup when /var/lib/kubelet is a symlink.
2018-09-26 14:42:44 -07:00
Hemant Kumar 6eda6d1a06 Make sure we pass mount options while creating bind mounts
This fixes an inconsitency that exists in mounter
2018-09-26 15:12:05 -04:00
k8s-ci-robot c7a67b3e1b
Merge pull request #68626 from gnufied/fix-netdev-mount-opt
Apply _netdev mount option in bind mount if available
2018-09-25 17:00:36 -07:00
andyzhangx 74f010260f fix UnmountDevice failure on Windows
add comments

fix test failure
2018-09-19 01:44:01 +00:00
David Zhu 704573d304 GetMountRefs shouldn't error when file doesn'g exist in Windows and nsenter. Add unit test 2018-09-18 10:45:02 -07:00
David Zhu 9d207b3e3c GetMountRefs should not fail if the path supplied does not exist anymore. It has no mount references 2018-09-17 17:35:12 -07:00
Jan Safranek 9e24ccbda0 Fixed subpath cleanup when /var/lib/kubelet is a symlink. 2018-09-17 15:52:25 +02:00
Hemant Kumar e881a29107 Apply _netdev mount option in bind mount if available
_netdev mount option is a userspace mount option and
isn't copied over when bind mount is created and remount
also does not copies it over and hence must be explicitly
used with bind mount
2018-09-13 13:47:34 -04:00
NickrenREN 8d3fdc5a32 fix UT errors and add new UTs 2018-09-03 13:35:17 +08:00
NickrenREN 7157d4582b make pathWithinBase public 2018-09-03 13:34:56 +08:00
linyouchong 708cff1a43 Fix unit test failure: TestNsenterExistsFile 2018-08-02 00:01:53 +08:00
Russ Cox 2bd91dda64 kubernetes: fix printf format errors
These are all flagged by Go 1.11's
more accurate printf checking in go vet,
which runs as part of go test.

Lubomir I. Ivanov <neolit123@gmail.com>
applied ammend for:
  pkg/cloudprovider/provivers/vsphere/nodemanager.go
2018-07-11 00:10:15 +03:00
andyzhangx 27bc865cc1 fix smb mount security issue 2018-07-03 08:03:31 +00:00
Kubernetes Submit Queue 24ab69d358
Merge pull request #65447 from wongma7/mapvolume-symlink
Automatic merge from submit-queue (batch tested with PRs 65492, 65516, 65447). 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>.

Resolve potential devicePath symlink when MapVolume in containerized kubelet

**What this PR does / why we need it**: Ensures local block volumes will work in case kubelet is running in a container

**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 #65445

**Special notes for your reviewer**: Code is mostly plumbing. If there is a better way to do it, let me know :)

I assume there will be e2e tests for the non-containerized case. I will need to test the containerized case myself, which may take a while.
**Release note**:

```release-note
NONE
```
2018-06-27 02:15:12 -07:00
Matthew Wong b376b31ee0 Resolve potential devicePath symlink when MapVolume in containerized kubelet 2018-06-26 13:08:36 -04:00
Jeff Grafton 23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Jeff Grafton a725660640 Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
Yecheng Fu c542b6be5d Remove mount.GetMountRefs in favor of mounter.GetMountRefs 2018-06-20 17:01:27 +08:00
Kubernetes Submit Queue 148350d3c4
Merge pull request #64426 from cofyc/remove_unnecessary_fakemounters
Automatic merge from submit-queue (batch tested with PRs 64142, 64426, 62910, 63942, 64548). 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>.

Clean up fake mounters.

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

Fixes https://github.com/kubernetes/kubernetes/issues/61502

**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**:

list of fake mounters:

- (keep) pkg/util/mount.FakeMounter
- (removed) pkg/kubelet/cm.fakeMountInterface:
- (inherit from mount.FakeMounter) pkg/util/mount.fakeMounter
- (inherit from mount.FakeMounter) pkg/util/removeall.fakeMounter
- (removed) pkg/volume/host_path.fakeFileTypeChecker

**Release note**:

```release-note
NONE
```
2018-06-20 00:05:10 -07:00
Michelle Au f3f1a04705 Only mount subpath as readonly if specified in volumeMount 2018-06-04 12:05:23 -07:00
Yecheng Fu 40c3937320 Clean up fake mounters. 2018-06-02 15:55:19 +08:00
Kubernetes Submit Queue 2aced6d9e4
Merge pull request #63248 from andyzhangx/formatAndMount-windows
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>.

fix formatAndMount func issue on Windows

**What this PR does / why we need it**:
disk format code is missing in formatAndMount func on Windows, currently it only has mount related code:
b87a392b1a/pkg/util/mount/mount_windows.go (L356-L377)

format code is now here, which is not correct(invoked in `azuredisk.WaitForAttach` operation, it's not correct, these code should be in `formatAndMount` func and invoked by `MountDevice` operation finally)
b87a392b1a/pkg/volume/azure_dd/azure_common_windows.go (L100-L117)

**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 #63236 

**Special notes for your reviewer**:
This is the first PR,  in second PR, I will remove disk format code in azure_common_windows.go
b87a392b1a/pkg/volume/azure_dd/azure_common_windows.go (L100-L117)

Also need to mention that there would not be issue if  following command invoked twice(by `WaitForAttach` and `formatAndMount`)
```
Get-Disk -Number 4 | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle MBR -PassThru  | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -FileSystem ntfs -Confirm:$false
```
**Release note**:

```
fix formatAndMount func issue on Windows
```

/sig windows
/assign @rootfs 
cc @msau42
2018-06-01 21:25:57 -07:00