Commit Graph

52 Commits

Author SHA1 Message Date
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
mengjiao.liu
c24b87b133 Fixed a possible nil pointer dereference caused by variable plug 2021-05-21 10:17:04 +08:00
Jan Safranek
6f8bdb7cc1 Fix FibreChannel volume plugin corrupting filesystem on detach
FibreChannel volume plugin misses one important step when removing a
device: "multipath -f". It flushes all multipath buffers to its individual
paths. Without it, a filesystem on the device may get corrupted.
2020-12-02 14:39:00 +01:00
Srini Brahmaroutu
fbe5daed73 Change code to use staging/k8s.io/mount-utils 2020-09-16 21:51:24 -07:00
Jan Safranek
58129fd12c Fix mount options in FibreChannel volumes
Do not mount volumes in WaitForAttach(), mount them in MountDevice()
instead. They will get proper mount options this way.
2020-03-26 18:01:19 +01: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
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
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
Robert Krawitz
5b97b2860d Change fsGroup to mounterArgs in volume.SetUp() to allow for future extension. 2019-05-29 15:12:28 -04:00
Matthew Wong
dd517c9ff2 Update all tests to account for BlockVolume enabled by default 2018-11-16 13:38:59 -05:00
Cheng Pan
065e4543b7 Fix golint issues for pkg/volume/{fc,flocker} packages 2018-10-09 06:04:00 +00:00
Yecheng Fu
c542b6be5d Remove mount.GetMountRefs in favor of mounter.GetMountRefs 2018-06-20 17:01:27 +08:00
Ian Chakeres
3fc5601e35 Return error in mount_unsupported for unsupported platforms 2018-03-29 14:17:07 -07:00
Ian Chakeres
470980d4a8 Skip volume unit tests that don't work on osx. 2018-03-26 12:47:36 -07:00
jianglingxia
d759c601b6 FIX the os.Stat() func in volume file/kind bug 2018-02-24 19:31:21 +08:00
linyouchong
e92f6eb0fe fix incorrect logic in canSupport 2018-02-09 11:45:15 +08:00
mtanino
41cb533ad6 [FC Plugin] Create proper volumeSpec during ConstructVolumeSpec
Currently, FC plugin returns volume name and empty
FCVolumeSource during ConstrutVolumeSpec during
filesystem volume's reconstruction.

In this fix, ConstructVolumeSpec retrieves global
mount path, analyzes volume parameters such as
WWN, LUN, WWID from the path.

Fixes #58085
2018-01-11 12:04:56 -05:00
mtanino
1443b1bd1f Update detach logic for block volume if devicePath is empty 2017-12-15 11:56:14 -05:00
mtanino
224d39b06b Block volumes Support: FC plugin update
This patch adds block volume support to FC volume plugin.
2017-11-20 16:46:39 -05:00
linyouchong
02e8ffe13c fix incorrect log 2017-10-26 01:40:24 +08:00
linyouchong
66d68d7d2a Abstract contains func to common place 2017-10-20 19:27:55 +08:00
Cheng Xing
396c3c7c6f Adding dynamic Flexvolume plugin discovery capability, using filesystem watch. 2017-08-25 11:42:32 -07:00
xiangpengzhao
35b45d60b2 Use Fatalf instead of Errorf when mounter/unmounter if nil in volume tests 2017-08-23 10:29:30 +08:00
Jan Safranek
0e547bae22 SafeFormatAndMount should use volume.Exec provided by VolumeHost
We need to execute mkfs / fsck where the utilities are.
2017-08-14 12:16:27 +02:00
mtanino
03e28476c4 FC plugin: Support WWID for volume identifier
This PR adds World Wide Identifier (WWID) parameter to
FCVolumeSource as an unique volume identifier.

fixes #48639
2017-08-10 09:59:31 -04:00
Kubernetes Submit Queue
25d3523359 Merge pull request #48940 from rootfs/fc-fencing
Automatic merge from submit-queue (batch tested with PRs 48377, 48940, 49144, 49062, 49148)

support fc volume attach and detach

**What this PR does / why we need it**:
Support FC volume attach and detach to enforce RWO access

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-07-19 19:10:12 -07:00
Jacob Simpson
29c1b81d4c Scripted migration from clientset_generated to client-go. 2017-07-17 15:05:37 -07:00
Huamin Chen
b887776880 add fc volume attacher
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-07-14 16:34:53 -04: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
deads2k
5a8f075197 move authoritative client-go utils out of pkg 2017-01-24 08:59:18 -05:00
deads2k
ee6752ef20 find and replace 2017-01-20 08:04:53 -05:00
Clayton Coleman
9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
deads2k
6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Chao Xu
03d8820edc rename /release_1_5 to /clientset 2016-12-14 12:39:48 -08:00
Chao Xu
bb675d395f dependencies: pkg/volume 2016-11-23 15:53:09 -08:00
Paul Morie
4722cb299b Remove GetRootContext from VolumeHost 2016-11-03 12:21:19 -04:00
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
saadali
542f2dc708 Introduce new kubelet volume manager
This commit adds a new volume manager in kubelet that synchronizes
volume mount/unmount (and attach/detach, if attach/detach controller
is not enabled).

This eliminates the race conditions between the pod creation loop
and the orphaned volumes loops. It also removes the unmount/detach
from the `syncPod()` path so volume clean up never blocks the
`syncPod` loop.
2016-06-15 09:34:08 -07:00
Clayton Coleman
fdb110c859
Fix the rest of the code 2016-04-29 17:12:10 -04:00
saadali
79012f6d53 Rename volume.Builder to Mounter and volume.Cleaner to Unmounter 2016-03-25 11:29:58 -07:00
Tim St. Clair
246b389275 Move test-only volume files to test-only volume package 2016-02-29 14:44:28 -08:00
Chao Xu
ad46715f51 generate fake client for release_1_2 2016-02-17 16:10:02 -08:00
Tim Hockin
7cab7bd472 fix a few go-vet errors 2016-02-09 13:20:31 -08:00
Chao Xu
c72d234bbf replacing handwritten client in several controllers 2016-01-31 15:42:02 -08:00
Fabio Yeon
7205a160ac Remove all instances of "/tmp" from unit tests and replace with a common
tmp directory creator. Exception is documented.
2016-01-27 16:11:22 -08:00
k8s-merge-robot
3f5e417999 Merge pull request #19502 from swagiaal/internalize-ownership
Auto commit by PR queue bot
2016-01-26 23:06:39 -08:00
Clayton Coleman
33085c0cf2 Update tests to handle codec changes 2016-01-22 13:27:26 -05:00
Sami Wagiaalla
f650648aae Add fsGroup to SetUp and SetUpAt 2016-01-13 10:37:10 -05:00