Commit Graph

98 Commits (0fc2c4844454be18961ad1b4446ef3c9540d20e6)

Author SHA1 Message Date
Kubernetes Submit Queue fc19fc9908
Merge pull request #58519 from linyouchong/lyc-probe
Automatic merge from submit-queue (batch tested with PRs 60073, 58519, 61860). 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>.

flexvolume prober: trigger plugin init only for the relevant plugin

**What this PR does / why we need it**:
The automatic discovery trigger init only to the specific plugin directory that was updated, and not to all the plugins in the flexvolume plugin directory.

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

**Special notes for your reviewer**:
NONE
**Release note**:

```
NONE
```
2018-04-02 17:07:01 -07:00
linyouchong 128c07fb1e automatic plugin discovery should trigger plugin init only for the relevant plugin 2018-03-30 14:23:44 +08:00
technicianted 0fb8072b19 reduce nesting 2018-03-09 21:03:22 -08:00
technicianted 659d9df117 added missing error check 2018-03-08 21:39:22 -08:00
wackxu f737ad62ed update import 2018-02-27 20:23:35 +08:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
jolestar eb35cee9f8 Remove unused command waitfordetach from flex volume driver 2018-01-03 16:02:31 +08:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Kubernetes Submit Queue ea55d70ee7
Merge pull request #56921 from andyzhangx/flexvolume-windows
Automatic merge from submit-queue (batch tested with PRs 56650, 55813, 56911, 56921, 56871). 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>.

enable flexvolume on Windows node

**What this PR does / why we need it**:
enable flexvolume on Windows node:
current PodVolumeDir is like 
`\var\lib\kubelet\pods\f54c5a74-da63-11e7-b71a-000d3a02c330\volumes\test~hostpath.cmd\flextest`
which is a unix path, with this PR, PodVolumeDir in **windows** kubelet  will be converted into like
`c:\var\lib\kubelet\pods\f54c5a74-da63-11e7-b71a-000d3a02c330\volumes\test~hostpath.cmd\flextest` 

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

**Special notes for your reviewer**:
Detailed steps about how to use flexvolume on Windows with this PR:
https://github.com/andyzhangx/Demo/tree/master/windows/flexvolume

**Release note**:

```
enable flexvolume on Windows node
```

/sig windows
2017-12-16 12:10:51 -08:00
Jordan Liggitt d073c10dbc
Refactor flex pv to allow secret namespace 2017-12-13 23:32:16 -05:00
andyzhangx 5c7a1a2c5d enable flexvolume on Windows 2017-12-07 06:24:20 +00:00
Di Xu be8c5af15f include error message for volumeManager during attach and mount 2017-11-20 17:53:55 +08:00
Kubernetes Submit Queue d4d326b39d
Merge pull request #54856 from jsafrane/fix-detacher-param-name
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>.

Rename Detach() parameter.

`Detach()` does not get device name, it gets volume name. Parameters named `deviceMountPath` or `deviceName` just confuses developers.

Note that this PR  just renames parameters here and there, there should be no behavior change.

@kubernetes/sig-storage-pr-reviews 

/assign @gnufied @jingxu97 

**Release note**:
```release-note
NONE
```
2017-11-03 14:33:16 -07:00
Jan Safranek 6f160c3570 Rename Detach() parameter.
Detach() does not get device name, it gets volume name.
2017-10-31 10:55:19 +01:00
Michelle Au 7d1e279d3b Update volume OWNERS to reflect active sig-storage reviewers 2017-10-26 13:26:33 -07:00
linyouchong 66d68d7d2a Abstract contains func to common place 2017-10-20 19:27:55 +08:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Kubernetes Submit Queue 3752a511a4 Merge pull request #52662 from xiangpengzhao/volume-const
Automatic merge from submit-queue (batch tested with PRs 52662, 53547, 53588, 53573, 53599). 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>.

Use const instead of hard code for volume plugin

**What this PR does / why we need it**:
nits: cleanup hard-coded volume plugin name

**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
NONE
```
2017-10-09 12:51:14 -07:00
Kubernetes Submit Queue d6f76a000d Merge pull request #49539 from avagin/flexvol
Automatic merge from submit-queue (batch tested with PRs 47806, 49539, 48763, 47049, 50600). 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>..

flexvolume: remove a mount directory in a error case

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

flexVolumeMounter.SetUpAt creates a directory, where a volume has to be
mounted, and we have to remove this directory in a error case. Otherwise
we see errors like this:

Orphaned pod 673b66d9-70f7-11e7-a5fa-525400307392 found, but volume paths are still present on disk

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

https://github.com/kubernetes/kubernetes/issues/49383

**Special notes for your reviewer**:

**Release note**:

Fix a rollback code for the flexvolume mount operation
2017-09-22 21:20:51 -07:00
xiangpengzhao 39a996ea98 Use const instead of hard code for volume plugin 2017-09-18 20:09:07 +08:00
Kubernetes Submit Queue f07279ada2 Merge pull request #51474 from verult/ProberTest
Automatic merge from submit-queue (batch tested with PRs 51805, 51725, 50925, 51474, 51638)

Flexvolume dynamic plugin discovery: Prober unit tests and basic e2e test.

**What this PR does / why we need it**: Tests for changes introduced in PR #50031 .
As part of the prober unit test, I mocked filesystem, filesystem watch, and Flexvolume plugin initialization.
Moved the filesystem event goroutine to watcher implementation.

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

**Special notes for your reviewer**:
First commit contains added functionality of the mock filesystem.
Second commit is the refactor for moving mock filesystem into a common util directory.
Third commit is the unit and e2e tests.

**Release note**:

```release-note
NONE
```
/release-note-none
/sig storage
/assign @saad-ali @liggitt 
/cc @mtaufen @chakri-nelluri @wongma7
2017-09-03 11:10:05 -07:00
Cheng Xing 52a77aaccd Added basic Flexvolume dynamic plugin discovery e2e test; added Flexvolume prober unit tests. 2017-08-31 16:50:02 -07:00
Kubernetes Submit Queue 7100d00491 Merge pull request #51342 from wongma7/flex-nil
Automatic merge from submit-queue

Set flexvolumeplugin.host so that it's not nil

@TerraTech @MikaelCluseau  @chakri-nelluri @verult

I assume this line was removed inadvertently, without plugin.host set the flexvolume silently fails at Mount/Attach* time. https://github.com/kubernetes/kubernetes/pull/50843

https://github.com/kubernetes/kubernetes/issues/51123

Please review, thanks!

```release-note
NONE
```
2017-08-28 12:07:18 -07:00
mtanino 5ff9dc0b3b WaitForAttach refactoring for iSCSI attacher/detacher
This change is prerequisite for implementing iSCSI attacher
and detacher.

In order to use chap authentication at iSCSI plugin after
implementing attacher and detacher, secret is needed at
AttachDisk() which is called from WaitForAttach().
To obtain secret, pod information is required, but
WaitForAttach() doesn't pass pod information inside.

This patch adds 'pod' as an argument of WaitForAttach()
and adds changes to drivers who implements WaitForAttach().

Fixes #48953
2017-08-26 17:21:34 -04:00
Cheng Xing 396c3c7c6f Adding dynamic Flexvolume plugin discovery capability, using filesystem watch. 2017-08-25 11:42:32 -07:00
Matthew Wong 8b5b2e9927 Set flexvolumeplugin.host so that it's not nil 2017-08-25 13:36:17 -04:00
Mikaël Cluseau 22d5e4810b refactor(flexvolume): simplify capabilities handling 2017-08-24 22:18:58 +11:00
Kubernetes Submit Queue 4fb6c2891c Merge pull request #50843 from TerraTech/fvs-selinuxRelabel-init-1.8.x
Automatic merge from submit-queue (batch tested with PRs 51105, 51097, 51110, 50843, 51107)

FlexVolume: Add ability to control 'SupportsSELinux' during driver's init phase

**What this PR does / why we need it**:
Adds the ability to disable FlexVolume SELinux relabeling for filesystems that don't support it, e.g. fuse

**Which issue this PR fixes**:
This was reported in: https://github.com/lizardfs/lizardfs/issues/581

This is a reworked solution as per feedback from #50548 
https://github.com/kubernetes/kubernetes/pull/50548#issuecomment-322328679

**Special notes for your reviewer**:
/assign @thockin 
/cc @chakri-nelluri @verult @saad-ali 

**Release note**:

```release-note
NONE
```
2017-08-23 05:51:28 -07:00
core 07cfade1fc FlexVolume: Add capability to disable SELinux Relabeling during the driver's init phase
Reference:  https://github.com/lizardfs/lizardfs/issues/581  (SELinux relabeling support)
2017-08-22 03:31:34 -07: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
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
Jeff Grafton a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton 33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
Andrei Vagin ad0ec2388f flexvol: remove a mount directory in a error case
flexVolumeMounter.SetUpAt creates a directory, where a volume has to be
mounted, and we have to remove this directory in error cases. Otherwise
we will see errors like this:

Orphaned pod 673b66d9-70f7-11e7-a5fa-525400307392 found, but volume paths are still present on disk

https://github.com/kubernetes/kubernetes/issues/49383
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-07-25 10:38:39 -07:00
deads2k 94e9993900 remove deads2k from volume reviewer 2017-07-25 08:52:25 -04:00
Jan Pazdziora 6b7d4b7922 Allow unmounting bind-mounted directories.
For bind-mounted directories, the isNotMounted which calls
IsLikelyNotMountPoint fails because the filesystem of the mounted
location and the parent directory are the same.

Addressing:
unmounter.go:59] Warning: Path: /path/.../test-dir already unmounted
2017-07-24 13:33:10 +02:00
ymqytw 9b393a83d4 update godep 2017-07-20 11:03:49 -07:00
ymqytw 3dfc8bf7f3 update import 2017-07-20 11:03:49 -07:00
Jan Pazdziora 1ebd51aa70 If the init fails for whatever reason, plugin is nil and cannot be used.
Addressing
=== RUN   TestCanSupport
E0719 13:48:19.829849    2289 driver-call.go:232] init command failed, status: Successx, reason:
--- FAIL: TestCanSupport (0.00s)
	flexvolume_test.go:180: Can't find the plugin by name
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x11fc5b5]
2017-07-19 16:08:45 +02:00
Kubernetes Submit Queue 86a42b8796 Merge pull request #46973 from php-coder/improve_flex_logging
Automatic merge from submit-queue (batch tested with PRs 46973, 48556)

Improve error reporting when flex driver has failed to initialize

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

This PR improves error reporting for the case when flex driver is failing to initialize. There are 2 improvements:

1) show only the plugin name instead of a full struct. This makes a message shorter and removes useless and internal information.

Before:
>E0605 16:44:59.330215   26786 plugins.go:359] Failed to load volume plugin &{k8s/nfs /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s~nfs %!s(*kubelet.kubeletVolumeHost=&{0xc431ea5800 {{1 0} map[kubernetes.io/downward-api:0xc431ee3f20 kubernetes.io/aws-ebs:0xc431ee3eb0 kubernetes.io/git-repo:0xc431ee3ef0 kubernetes.io/host-path:0xc430e985f0 kubernetes.io/rbd:0xc42bfab840 kubernetes.io/quobyte:0xc431ee3f00 kubernetes.io/fc:0xc42bfab980 kubernetes.io/empty-dir:0xc431ee3ed0 kubernetes.io/nfs:0xc430e98640 kubernetes.io/iscsi:0xc42bfab720 kubernetes.io/glusterfs:0xc430faaba0 kubernetes.io/cinder:0xc42bfab8c0 kubernetes.io/gce-pd:0xc431ee3ee0 kubernetes.io/secret:0xc42bfab6a0 kubernetes.io/flocker:0xc431ee3f30 kubernetes.io/cephfs:0xc431ee3f10]} 0xc42698cf40}) %!s(*exec.executor=&{}) {%!s(int32=0) %!s(uint32=0)} []}, error: unexpected end of JSON input

After:
>E0605 16:59:45.520185   29041 plugins.go:359] Failed to load volume plugin k8s/nfs, error: unexpected end of JSON input

2) quote script output. In case the output was empty, messages look a bit better:

Before:
> E0605 16:44:59.330077   26786 driver-call.go:212] Failed to unmarshal output for command: init, **output: **, error: unexpected end of JSON input
> W0605 16:44:59.330170   26786 driver-call.go:140] FlexVolume: driver call failed: executable: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s\~nfs/nfs, args: [init], error: fork/exec /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s\~nfs/nfs: permission denied, **output: **

After:
>E0605 16:59:45.519906   29041 driver-call.go:212] Failed to unmarshal output for command: init, **output: ""**, error: unexpected end of JSON input
>W0605 16:59:45.520109   29041 driver-call.go:140] FlexVolume: driver call failed: executable: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s\~nfs/nfs, args: [init], error: fork/exec /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s\~nfs/nfs: permission denied, **output: ""**
2017-07-15 18:02:36 -07:00
Mike Danese c201553f27 remove some people from OWNERS so they don't get reviews anymore
These are googlers who don't work on the project anymore but are still
getting reviews assigned to them:
- bprashanth
- rjnagal
- vmarmol
2017-07-13 10:02:21 -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
Kubernetes Submit Queue d021db8204 Merge pull request #47503 from chakri-nelluri/flexcap
Automatic merge from submit-queue (batch tested with PRs 47878, 47503, 47857)

Remove controller node plugin driver dependency for non-attachable fl…

…ex volume drivers (Ex: NFS).

**What this PR does / why we need it**:
Removes requirement to install flex volume drivers on master node for non-attachable drivers likes NFS.

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


```release-note
Fixes issue w/Flex volume, introduced in 1.6.0, where drivers without an attacher would fail (node indefinitely waiting for attach). Drivers that don't implement attach should return `attach: false` on `init`.
```
2017-06-21 21:12:15 -07:00
Kubernetes Submit Queue 03014f486c Merge pull request #47824 from mbohlool/revert2
Automatic merge from submit-queue (batch tested with PRs 47851, 47824, 47858, 46099)

Revert 44714 manually

#44714 broke backward compatibility for old swagger spec that kubectl still uses. The decision on #47448 was to revert this change but the change was not automatically revertible. Here I semi-manually remove all references to UnixUserID and UnixGroupID and updated generated files accordingly.

Please wait for tests to pass then review that as there may still be tests that are failing.

Fixes #47448

Adding release note just because the original PR has a release note. If possible, we should remove both release notes as they cancel each other.

**Release note**: (removed by caesarxuchao)

UnixUserID and UnixGroupID is reverted back as int64 to keep backward compatibility.
2017-06-21 15:21:14 -07:00
Kubernetes Submit Queue 0a6d307700 Merge pull request #34515 from jimengliu/master
Automatic merge from submit-queue (batch tested with PRs 34515, 47236, 46694, 47819, 47792)

remove unused constant

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

In flexvolume constant definitions, fix typo StatusFailure string to "Failure", not "Failed" at 

b359034817/pkg/volume/flexvolume/flexvolume_util.go (L45)

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

**Special notes for your reviewer**:
Simple string literal change, but hopefully will prevent future confusion for developers.
2017-06-21 13:30:04 -07:00
mbohlool c91a12d205 Remove all references to types.UnixUserID and types.UnixGroupID 2017-06-21 04:09:07 -07:00
Chakravarthy Nelluri 894b9b2add Remove controller node plugin driver dependency for non-attachable flex volume drivers (Ex: NFS). 2017-06-17 14:12:43 -04:00
Kubernetes Submit Queue fdc6746818 Merge pull request #46382 from verult/FlexVolumeMinorPatches
Automatic merge from submit-queue (batch tested with PRs 38751, 44282, 46382, 47603, 47606)

Adding 'flexvolume' prefix to FlexVolume plugin names.

**What this PR does / why we need it**: Adds a prefix to FlexVolume plugin names in order to more easily identify plugins as FlexVolume. Improves debugging.

**Special notes for your reviewer**: Unfortunately the delimiter after 'flexvolume' is restricted to either '-' or '.' . This makes the prefix seem like it's part of the vendor name. Not sure if this could cause issues later on.

**Release note**:

```release-note
NONE
```
2017-06-16 18:05:51 -07:00
Chakravarthy Nelluri 7885aaf689 Remove broken getvolumename and pass PV or volume name to attach call 2017-06-13 00:32:38 -04:00