Commit Graph

1723 Commits (0fc2c4844454be18961ad1b4446ef3c9540d20e6)

Author SHA1 Message Date
Lukasz Piatkowski 645d0d8e81 fix typo that redefines variable and breaks code 2018-04-05 13:49:02 +00:00
Kubernetes Submit Queue f167e16914
Merge pull request #62012 from andyzhangx/local-windows-fix
Automatic merge from submit-queue (batch tested with PRs 60983, 62012, 61892, 62051, 62067). 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 local volume issue on Windows

**What this PR does / why we need it**:
Actually local volume does not work on Windows up to now, with this PR, local volume would work on Windows. Here is a [local volume example on Windows](https://github.com/andyzhangx/demo/tree/master/windows/local) 

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

**Special notes for your reviewer**:
This PR would not `MkdirAll(dir, 0750)` on windows node, the MkdirAll process would happen on https://github.com/kubernetes/kubernetes/blob/master/pkg/util/mount/mount_windows.go#L59-L62

**Release note**:

```
fix local volume issue on Windows
```

/sig windows
/sig storage
2018-04-03 11:33:13 -07:00
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
Kubernetes Submit Queue c079d1e6af
Merge pull request #61096 from mlmhl/csi_secret
Automatic merge from submit-queue (batch tested with PRs 61096, 61955, 61542, 60597). 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>.

Return error if get NodeStageSecret and NodePublishSecret failed

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

Currently, if got NodeStageSecret  or NodePublishSecret failed, we just log the error and assume that there is no credential. I think we should report the error as if user specified these secret, they expect to apply some credentials.

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

**Release note**:

```release-note
NONE
```

/sig storage
2018-04-02 15:35:02 -07:00
andyzhangx d3d3018860 fix local volume issue on windows 2018-04-02 08:15:30 +00:00
Kubernetes Submit Queue 7ce753aa73
Merge pull request #61894 from atlassian/misc-cleanups
Automatic merge from submit-queue (batch tested with PRs 61894, 61369). 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 range in loops; misc fixes

**What this PR does / why we need it**:
It is cleaner to use `range` in for loops to iterate over channel until it is closed.

**Release note**:
```release-note
NONE
```
/kind cleanup
2018-03-30 21:16: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
Mikhail Mazurskiy c23a8a85cc
Use range in loops; misc fixes 2018-03-29 22:55:25 +11:00
wackxu 3076dc1190 update bazel and gofmt 2018-03-28 16:08:15 +08:00
wackxu 5ed705faf8 Remove alpha annotation for volume node affinity 2018-03-28 14:45:06 +08:00
Kubernetes Submit Queue 06e3fefc21
Merge pull request #61738 from ianchakeres/osx-volume-ut-fix
Automatic merge from submit-queue (batch tested with PRs 61452, 61727, 61462, 61692, 61738). 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>.

Skip volume unit tests that don't work on osx.

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

`volume/fc` and `volume/rbd` unit tests fail on osx.

```
$ pwd
<snip>/gopath/src/k8s.io/kubernetes/pkg/volume/fc
$ go test
--- FAIL: Test_ConstructVolumeSpec (0.00s)
    fc_test.go:450: couldn't fetch mountrefs
    fc_test.go:469: failed to retrieve WWIDs
    fc_test.go:450: couldn't fetch mountrefs
    fc_test.go:469: failed to retrieve WWIDs
FAIL
exit status 1
FAIL    k8s.io/kubernetes/pkg/volume/fc    0.054s
<snip>
$ pwd
<snip>/gopath/src/k8s.io/kubernetes/pkg/volume/rbd
$ go test
--- FAIL: TestConstructVolumeSpec (0.00s)
	rbd_test.go:575: ConstructVolumeSpec failed: directory /var/folders/59/yc7_f4fd53nbyw868zqpk78cn7shx9/T/rbd_test144865306/pods/pod123/volumes/kubernetes.io~rbd/vol is not mounted
	rbd_test.go:575: ConstructVolumeSpec failed: directory /var/folders/59/yc7_f4fd53nbyw868zqpk78cn7shx9/T/rbd_test144865306/pods/pod123/volumes/kubernetes.io~rbd/vol is not mounted
FAIL
exit status 1
FAIL	k8s.io/kubernetes/pkg/volume/rbd	0.063s
```

**Which issue(s) this PR fixes** :
Fixes #61569 and #61571 

**Special notes for your reviewer**:

To see these unit test fail, you need to run `go test` on an osx machine.

**Release note**:
```release-note
NONE
```
2018-03-27 09:47:22 -07:00
Ian Chakeres 470980d4a8 Skip volume unit tests that don't work on osx. 2018-03-26 12:47:36 -07:00
Kubernetes Submit Queue 915798d229
Merge pull request #60563 from hzxuzhonghu/replace-context
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>.

Replace package "golang.org/x/net/context" with "context"

**What this PR does / why we need it**:
Replace package "golang.org/x/net/context" with "context"

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

**Special notes for your reviewer**:
As of Go 1.7 this package(golang.org/x/net/context) is available in the standard library under the name context. see (https://godoc.org/golang.org/x/net/context)

It is almost machinery replace. 

**Release note**:

```release-note
NONE
```
2018-03-23 16:34:23 -07:00
Kubernetes Submit Queue d23066e8b3
Merge pull request #61373 from msau42/subpath-reconstruct
Automatic merge from submit-queue (batch tested with PRs 61453, 61393, 61379, 61373, 61494). 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 inner volume name instead of outer volume name for subpath directory

**What this PR does / why we need it**:
Fixes volume reconstruction for PVCs with subpath

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

**Special notes for your reviewer**:


**Release note**:

```release-note
ACTION REQUIRED: In-place node upgrades to this release from versions 1.7.14, 1.8.9, and 1.9.4 are not supported if using subpath volumes with PVCs.  Such pods should be drained from the node first.
```
2018-03-22 06:20:28 -07:00
hzxuzhonghu 70e45eccf2 Replace "golang.org/x/net/context" with "context" 2018-03-22 20:57:14 +08:00
Kubernetes Submit Queue 28aa3c745a
Merge pull request #61267 from andyzhangx/respect-windows-disk
Automatic merge from submit-queue (batch tested with PRs 60793, 61181, 61267, 61252, 61334). 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>.

respect fstype in Windows for azure disk

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

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

**Special notes for your reviewer**:

**Release note**:

```
respect fstype in Windows for azure disk
```

/sig azure
/sig windows
/assign @feiskyer
2018-03-21 20:23:14 -07:00
Michelle Au 91c557f504 Use inner volume name instead of outer volume name for subpath directory 2018-03-21 17:13:38 -07:00
Kubernetes Submit Queue da2a8ff0d5
Merge pull request #60632 from humblec/iscsi-metrics
Automatic merge from submit-queue (batch tested with PRs 60632, 60806, 59471, 61251, 61013). 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>.

Add volumemetrics for ISCSI Plugin.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>



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

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

```release-note

```
2018-03-21 16:01:08 -07:00
Kubernetes Submit Queue a66301b313
Merge pull request #59536 from linyouchong/lyc-20180208
Automatic merge from submit-queue (batch tested with PRs 59536, 61104, 61030, 59013, 61169). 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 incorrect logic in glusterfs.go#canSupport

**What this PR does / why we need it**:
if `spec.PersistentVolume` is nil or `spec.Volume` is nil, func `canSupport` should return false.

**Release note**:
```
NONE
```
/release-note-none
/sig storage
2018-03-21 03:43:11 -07:00
Kubernetes Submit Queue b9eaad9037
Merge pull request #60788 from php-coder/fix_nfs_comments
Automatic merge from submit-queue (batch tested with PRs 59637, 60611, 60788, 60489, 60687). 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>.

pkg/volume/nfs/nfs.go: correct error messages

**What this PR does / why we need it**:
We don't use `IsLikelyNotMountPoint()` function since 45d21ee36b commit. This PR updates the error messages to mention a new function instead of the old one.
2018-03-20 04:34:38 -07:00
Kubernetes Submit Queue 7887fba3a5
Merge pull request #60611 from linyouchong/linyouchong-20180228
Automatic merge from submit-queue (batch tested with PRs 59637, 60611, 60788, 60489, 60687). 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>.

delete unused variable

delete unused variable in sio_plugin.go
**Release note**:
```
NONE
```
/release-note-none
/kink cleanup
2018-03-20 04:34:35 -07:00
Kubernetes Submit Queue ffe3bb2567
Merge pull request #60189 from jeffrey4l/log_warning
Automatic merge from submit-queue (batch tested with PRs 60189, 59542, 59931, 60621, 60353). 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>.

Log warning message when failed to remove rbd lock

It is hard to debug without any error message when lock is not removed
successfully.
2018-03-20 00:42:06 -07:00
Kubernetes Submit Queue 8684e581a1
Merge pull request #54970 from jianglingxia/jlx-storageos
Automatic merge from submit-queue (batch tested with PRs 60457, 60331, 54970, 58731, 60562). 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>.

Remove val and ok in Storageos

**What this PR does / why we need it**:
in for loop has define the two para 
**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**:

```release-note
NONE
```
2018-03-19 23:42:15 -07:00
mlmhl b9606696c9 return error if get NodeStageSecret and NodePublishSecret failed 2018-03-20 12:57:08 +08:00
Kubernetes Submit Queue c64f19dd1b
Merge pull request #59728 from wgliang/master.append
Automatic merge from submit-queue (batch tested with PRs 59740, 59728, 60080, 60086, 58714). 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>.

more concise to merge the slice

**What this PR does / why we need it**:
more concise to merge the slice

**Special notes for your reviewer**:
2018-03-19 21:34:30 -07:00
andyzhangx 0ffa961ea3 respect fstype in Windows for azure disk 2018-03-16 08:25:03 +00:00
Humble Chirammal 2f9f78206e Add volumemetrics for ISCSI Plugin.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-03-15 13:40:50 +05:30
Kubernetes Submit Queue 6571be1311
Merge pull request #60962 from technicianted/flex_race_fix
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>.

Added missing error check that could cause kubelet to crash

**What this PR does / why we need it**:
Adds missing error check. An error can happen due to a race condition when watched files change, or become inaccessible. This can happen if a file was added to the driver directory then quickly removed, in which case the callback will be called with non-nil `err` and nil `info`, which is not checked, causing kubelet to crash.

**Which issue(s) this PR fixes**:
Fixes #60861

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-12 16:17:02 -07:00
Kubernetes Submit Queue 557de1e3e0
Merge pull request #61011 from mlmhl/csi_readonly
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>.

Set readOnly for CSI mounter

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

Currently the `csiMountMgr .readOnly` field is never set, we should set it to `Spec.ReadOnly`.

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

**Special notes for your reviewer**:

Currently, most of the volume plugins use a `getVolumeSourceFromSpec` method to fetch `VolumeSource` and `ReadOnly` from `volume.Spec`. If the volume is an inline volume, `ReadOnly` is fetched from `Spec.Volume.<SpecificVolumeSource>.ReadOnly`, and if the volume is a `PersistentVolume`, `ReadOnly` is set to `Spec.Readonly`, which comes from `PersistentVolumeClaimVolumeSource.ReadOnly`.

However, as CSI volume plugin is only supported in `PersistentVolume`, so we can just set `ReadOnly` to `Spec.ReadOnly`.

**Release note**:

```release-note
NONE
```

/sig storage
2018-03-12 13:34:11 -07:00
mlmhl 4a3bdbecf9 set readOnly for CSI mounter 2018-03-11 11:16:20 +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
Slava Semushin 180535c1fc pkg/volume/nfs/nfs.go: correct error messages. 2018-03-05 12:12:51 +01:00
Jan Safranek 5110db5087 Lock subPath volumes
Users must not be allowed to step outside the volume with subPath.
Therefore the final subPath directory must be "locked" somehow
and checked if it's inside volume.

On Windows, we lock the directories. On Linux, we bind-mount the final
subPath into /var/lib/kubelet/pods/<uid>/volume-subpaths/<container name>/<subPathName>,
it can't be changed to symlink user once it's bind-mounted.
2018-03-05 09:14:44 +01:00
linyouchong 62021378c1 delete unused variable 2018-03-01 19:31:23 +08:00
andyzhangx dce507ce69 add remount logic for azure file plugin
fix comments
2018-03-01 07:46:07 +00:00
Kubernetes Submit Queue 2ae902a04e
Merge pull request #52900 from xiangpengzhao/remove-ed-const
Automatic merge from submit-queue (batch tested with PRs 60342, 60505, 59218, 52900, 60486). 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 consts defined in api instead of defining another ones.

**What this PR does / why we need it**:
empty_dir defines some consts. There are already similar consts in api types. So remove the local ones in empty_dir.

**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
```
2018-02-28 06:07:31 -08:00
Kubernetes Submit Queue a50984b4ff
Merge pull request #60342 from joelsmith/nested
Automatic merge from submit-queue (batch tested with PRs 60342, 60505, 59218, 52900, 60486). 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 nested volume mounts for read-only API data volumes

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

Since the runtime may try to create mount points within the sandbox, it will fail if the mount point is within a read-only API data volume, like a secret or configMap volume.

Create any needed mount points during volume setup.

**Which issue(s) this PR fixes**:
Fixes #60341

**Special notes for your reviewer**:


**Release note**:

No release note needed since we haven't released any versions with this bug present (yet)

```release-note
NONE

```
2018-02-28 06:07:21 -08:00
Ryan Hitchman 8aa3ca3cbb Add a few "+build linux" tags where appropriate. 2018-02-27 13:53:32 -08:00
Ryan Hitchman 0067002db8 Make a few code paths compile cleanly with 32-bit Go. 2018-02-27 13:53:32 -08:00
Kubernetes Submit Queue b13bfc74e2
Merge pull request #60337 from verult/repd-feature-gate
Automatic merge from submit-queue (batch tested with PRs 60157, 60337, 60246, 59714, 60467). 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>.

Feature gate for regional PDs

**What this PR does / why we need it**: Adding beta feature gate around regional PD support.

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

**Special notes for your reviewer**: This feature has already been in alpha for two releases, but at the time it was not gated with a Kubernetes feature gate. Instead it was controlled by a GCE-specific alpha gate. However, there are additional changes with GCE PD StorageClass parameters that we'd like to gate as well, and this is out of scope of GCE alpha gates.

/cc @saad-ali @lavalamp
2018-02-27 12:05:33 -08:00
Kubernetes Submit Queue 0a8e5f8012
Merge pull request #60115 from davidz627/csiMountDevice
Automatic merge from submit-queue (batch tested with PRs 60430, 60115, 58052, 60355, 60116). 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>.

CSI MountDevice/UnmountDevice Implementation

Fixes #60114

**What this PR does / why we need it**:
This PR Implements MountDevice and UnmountDevice for the CSI Plugin, the functions will call through to NodeStageVolume/NodeUnstageVolume for CSI plugins.

/sig storage

```release-note
Implements MountDevice and UnmountDevice for the CSI Plugin, the functions will call through to NodeStageVolume/NodeUnstageVolume for CSI plugins.
```
2018-02-27 09:38:40 -08:00
xiangpengzhao 22ea748809 Use consts defined in api instead of defining another ones. 2018-02-28 00:40:58 +08:00
Joel Smith 60c7ebf640 Fix nested volume mounts for read-only API data volumes
Since the runtime may try to create mount points within
the sandbox, it will fail if the mount point is within
a read-only API data volume, like a secret or configMap
volume.

Create any needed mount points during volume setup.
2018-02-27 07:41:39 -07:00
wackxu b3ba80b223 update bazel 2018-02-27 20:23:36 +08:00
wackxu f737ad62ed update import 2018-02-27 20:23:35 +08:00
wackxu a01f633e8e move fs into seperate directory to break cycle import 2018-02-27 19:58:41 +08:00
wackxu f268bb1605 merge util into one file 2018-02-27 19:58:41 +08:00
wackxu 2ca2f442ac Extract volumepathhandler into seperate directory 2018-02-27 19:58:41 +08:00
wackxu 8fe844d413 Extract recycler client into seperate directory 2018-02-27 19:58:41 +08:00