Commit Graph

3647 Commits

Author SHA1 Message Date
cndoit18
ec43037d0f style: remove redundant judgment
Signed-off-by: cndoit18 <cndoit18@outlook.com>
2022-08-25 12:07:36 +08:00
Mrunal Patel
65e693eccb Set correct SELinux label for host paths volumes created by host path provisioner
These host paths have a well known location under /tmp/hostpath_pv
and are therefore safe to be labeled with the shared SELinux label.

Without this label, the mounted volumes cannot be accessed by the
container processes.

Signed-off-by: Mrunal Patel <mpatel@redhat.com>
2022-08-24 17:57:47 -07:00
Kubernetes Prow Robot
69136c0c81
Merge pull request #111894 from wongma7/pvcnpd
Fix PVC nil pointer dereference during migration-enabled volume expand
2022-08-23 20:08:37 -07:00
Kubernetes Prow Robot
07bca2d791
Merge pull request #67782 from dims/yank-in-tree-openstack-cloud-provider
Remove in-tree openstack cloud provider
2022-08-23 18:59:48 -07:00
Kubernetes Prow Robot
71e534c580
Merge pull request #111527 from mengjiao-liu/clean-prometheus-in-volume
Cleanup: remove prometheus dependencies for volume
2022-08-23 16:05:31 -07:00
Davanum Srinivas
9bbf01bae9
Remove references to openstack and cinder
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-08-22 16:43:14 -04:00
Matthew Wong
a322a708f3 Fix PVC nil pointer dereference during migration-enabled volume expand 2022-08-17 11:32:22 -07:00
Kubernetes Prow Robot
64ed914545
Merge pull request #111258 from dobsonj/kep-596-ga-feature-flag
KEP-596: Move CSIInlineVolume feature to GA
2022-08-05 13:54:30 -07:00
Kubernetes Prow Robot
11d4cb52f2
Merge pull request #111693 from kinvolk/rata/userns-support-2022
volume: FeatureGate access to GetHostIDsForPod()
2022-08-05 09:37:48 -07:00
Léiyì Zhang
ea0fe5a33e remove const that's not used 2022-08-04 15:55:17 -07:00
Jonathan Dobson
5f774832a5 Move CSIInlineVolume feature to GA 2022-08-04 13:06:30 -06:00
Rodrigo Campos
4267f2ee0c volume: FeatureGate access to GetHostIDsForPod()
After the userns PR got merged:
	https://github.com/kubernetes/kubernetes/pull/111090

gnufied decided it might be safer if we feature gate this part of the
code, due to the kubelet volume host type assertion.

That is a great catch and this patch just moves the code inside the
feature gate if.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2022-08-04 14:08:29 +02:00
Jan Safranek
f9c7ce5b9c Add unit tests for DesiredStateOfWorldPopulator 2022-08-04 10:51:59 +02:00
Jan Safranek
39f0d78714 Add unit tests for GetPodVolumeNames 2022-08-04 10:51:57 +02:00
Jan Safranek
a01e720a1a Rename IsRWOP
To be able to update content of the function to other access modes when we
implement SELinux mount for more of them.
2022-08-04 10:51:54 +02:00
Jan Safranek
17d850ee0e Add interface for SELinuxOptionsToFileLabel
github.com/opencontainers/selinux/go-selinux needs OS that supports SELinux
and SELinux enabled in it to return useful data, therefore add an interface
in front of it, so we can mock its behavior in unit tests.
2022-08-04 10:51:51 +02:00
Jan Safranek
d9f792633d Add AddPodToVolume unit tests with SELinux 2022-08-04 10:51:50 +02:00
Jan Safranek
4df3f58737 Add SELinux feature check for iSCSI volume plugin
In theory the check is not necessary, but for sake of robustness and
completenes, let's check SELinuxMountReadWriteOncePod feature gate before
assuming anything about SELinux labels.
2022-08-04 10:51:47 +02:00
Jan Safranek
5c90474f38 Add SELinux mount support to CSI driver
With some minor refactoring to use common getCSIDriver function.
2022-08-04 10:51:45 +02:00
Jan Safranek
de7f5b66ed Fix existing unit tests 2022-08-04 10:51:44 +02:00
Jan Safranek
48b0751269 Add SELinux context tracking to volume manager
Both ActualStateOfWorld and DesiredStateOfWorld must track SELinux context
of volume mounts.
2022-08-04 10:51:41 +02:00
Jan Safranek
4cfb277e8b Implement mounting with -o context= in iSCSI volume plugin 2022-08-04 10:51:31 +02: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
Jan Safranek
f99cf5180e Add SELinux mount option to NewMounter() and MountDevice()
Let volume plugins decide if they want to mount volumes with "-o
context=XYZ" or let the container runtime relabel the volume on container
startup.

Using NewMounter, as it's the call where a volume plugin gets the other MountOptions.
2022-08-04 10:51:11 +02:00
Jiawei Wang
d52cdeae79 cleanup: Remove storageos volume plugins from k8s codebase 2022-08-03 20:19:59 +00:00
Kubernetes Prow Robot
4b6134b6dc
Merge pull request #111090 from kinvolk/rata/userns-support-2022
Add support for user namespaces phase 1 (KEP 127)
2022-08-03 13:05:47 -07:00
Rodrigo Campos
695b30e91c volume: use GetHostIDsForPod()
This commit only changes the UID/GID if user namespaces is enabled. When
it is enabled, it changes it so the hostUID and hostGID that are mapped
to the currently used UID/GID. This is needed so volumes are created
with the hostUID/hostGID and the user inside the container can read
them.

If user namespaces are disabled for this pod, this is a no-op: there is
no user namespace mapping, so the hostUID/hostGID are the same as inside
the container.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2022-08-03 19:53:22 +02:00
Rodrigo Campos
d07c2688fe kubelet: add GetHostIDsForPod()
In future commits we will need this to set the user/group of supported
volumes of KEP 127 - Phase 1.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2022-08-03 19:53:22 +02:00
Kubernetes Prow Robot
90f9a52db6
Merge pull request #111467 from RomanBednar/retro-sc-assignment
Allow retroactive storage class assigment to PVCs
2022-08-02 15:05:57 -07:00
Giuseppe Scrivano
eee5fa8b8d
volume: use the effective uid
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-08-02 23:47:58 +02:00
Kubernetes Prow Robot
369a465fae
Merge pull request #111301 from mattcary/migration-feature
Upgrade CSIMigrationGCE feature gate to GA
2022-08-02 13:58:57 -07:00
Roman Bednar
42b24b7baf move storage class helpers to utils 2022-08-02 20:52:04 +02:00
Kubernetes Prow Robot
70dcb0f129
Merge pull request #111618 from Jiawei0227/flocker
cleanup: Remove flocker volume plugins from k8s codebase
2022-08-02 09:16:16 -07:00
Kubernetes Prow Robot
c396744a6a
Merge pull request #110688 from jsafrane/test-iscsi
Fix iSCSI over ipv6
2022-08-02 09:15:56 -07:00
Matthew Cary
e5d387c5d6 Upgrade CSIMigrationGCE feature gate to GA
Change-Id: I620bc4913765c0d6562eb1008216a72e8b0a2970
2022-08-02 09:14:27 -07:00
Jiawei Wang
9c869b3dfc cleanup: Remove quobyte volume plugins from k8s codebase 2022-08-02 00:47:02 +00:00
Jiawei Wang
ff063889a7 cleanup: Remove flocker volume plugins from k8s codebase
Flocker storage plugin removed from k8s codebase.

Flocker, an early external storage plugin in k8s,
has not been in maintenance and their business is
down. As far as I know, the plugin is not being
used anymore.

This PR removes the whole flocker dependency and
codebase from core k8s to reduce potential security
risks and reduce maintenance work from the sig-storage community.
2022-08-02 00:42:50 +00:00
Kubernetes Prow Robot
b167260436
Merge pull request #110399 from claudiubelu/unittests-2
unittests: Fixes unit tests for Windows (part 2)
2022-08-01 15:04:29 -07:00
Kubernetes Prow Robot
1e18ff5b37
Merge pull request #111479 from wongma7/migrationawsga
Promote CSIMigrationAWS to GA
2022-08-01 13:18:29 -07:00
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
Kubernetes Prow Robot
3dc51872f0
Merge pull request #111485 from humblec/glusterfs-deprecation
deprecate GlusterFS plugin from available in-tree drivers.
2022-07-31 19:26:27 -07:00
Kubernetes Prow Robot
cf2800b812
Merge pull request #111402 from verb/111030-ec-ga
Promote EphemeralContainers feature to GA
2022-07-29 19:29:20 -07:00
Kubernetes Prow Robot
ca34eb1383
Merge pull request #111020 from claudiubelu/adds-unittests-5
unittests: Adds Windows unittests
2022-07-29 19:29:11 -07:00
Matthew Wong
777f43062c Remove unit tests that set & test CSIMigrationAWS false since it's now locked to true 2022-07-29 13:52:06 -07:00
Humble Chirammal
e675bfee59 deprecate GlusterFS plugin from available in-tree drivers.
GlusterFS is one of the first dynamic provisioner which made into
Kubernetes release v1.4.

https://github.com/kubernetes/kubernetes/pull/30888

When CSI plugins/drivers to start appear, glusterfs' CSI driver
came into existence, however this project is not maintianed at
present and the last release happened few years back.

https://github.com/gluster/gluster-csi-driver/releases/tag/v0.0.9

The possibilities of migration to compatible CSI driver was also
discussed https://github.com/kubernetes/kubernetes/issues/100897
and consensus was to start the deprecation in v1.25.

This commit start the deprecation process of glusterfs plugin from
in-tree drivers.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2022-07-29 12:18:48 +05:30
Mengjiao Liu
b449b44856 Cleanup: remove prometheus dependencies for volume
Co-authored-by: gavinfish <drfish.me@gmail.com>
2022-07-29 13:11:45 +08:00
Kubernetes Prow Robot
c27e82604e
Merge pull request #109217 from manugupt1/improve-mount-detection
Improved mount detection using openat2 for kernel 5.10+
2022-07-27 11:34:28 -07:00
Kubernetes Prow Robot
9ad4c5c0a0
Merge pull request #110670 from gnufied/fix-pod-deletion-terminating
Fix pod stuck in termination state when mount fails or gets skipped after kubelet restart
2022-07-27 06:31:29 -07:00
Manu Gupta
08ef11029f Fix type in mount_windows.go 2022-07-26 23:24:23 -07:00
Kubernetes Prow Robot
3ffdfbe286
Merge pull request #111254 from dims/update-to-golang-1.19-rc2
[golang] Update to 1.19rc2 (from 1.18.3)
2022-07-26 14:25:09 -07:00
Kubernetes Prow Robot
631a5a849a
Merge pull request #109778 from mythi/grpc-go-update
grpc: move to use grpc.WithTransportCredentials()
2022-07-26 12:45:09 -07:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Lee Verberne
d238e67ba6 Remove EphemeralContainers feature-gate checks 2022-07-26 02:55:30 +02:00
bennerv
3cc3ac56d8 Update Azure max data disk count map 2022-07-25 14:51:50 -04:00
muyangren2
70be87ac95 Fix test order 2022-07-25 14:49:24 +08:00
Hemant Kumar
835e8ccc76 Use CheckAndMarkAsUncertainViaReconstruction for uncertain volumes
Also only remove volumes from skippedDuringReconstruction only if
volume was marked as attached.
2022-07-22 20:11:37 -04:00
Hemant Kumar
b8257e8c01 Address review comments 2022-07-22 20:04:51 -04:00
Hemant Kumar
eb071c2755 Fix code to process volumes which were skipped during reconstruction 2022-07-22 20:04:51 -04:00
Hemant Kumar
c8b85fb470 Keep track of each pod that uses a volume during reconstruction
Add tests for volume cleaning up
2022-07-22 20:04:51 -04:00
Kubernetes Prow Robot
1c1efde70d
Merge pull request #109639 from Abirdcfly/fixduplicateimport
cleanup: remove all duplicate import
2022-07-18 16:55:23 -07:00
Abirdcfly
00b9ead02c cleanup: remove duplicate import
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-07-14 11:25:19 +08:00
Yubao Liu
834ce75f88 Make sure auto-mounted subpath mount source is already mounted
For example, we have two filesystems, one is embedded into another:

/a/test		# first filesystem with a directory "/a/test/b2"
/a/test/b2	# not auto mounted yet second filesystem, notice "/a/test/b2" is
	        # a new directory on this filesystem after this filesystem is mounted

For subpath mount "/a/test/b2",  `openat("/a/test", "b2")` gets directory "b2" on the first
filesystem, then "mount -c" will use this wrong directory as source directory.

`fstatat("/a/test", "b2/")` forces triggering auto mount of second filesystem, so
`openat("/a/test", "b2")` gets correct source directory for "mount -c".

This fixes issue https://github.com/kubernetes/kubernetes/issues/110818#issuecomment-1175736550

References:

1. https://man7.org/linux/man-pages/man2/openat.2.html

   If pathname refers to an automount point that has not yet
   been triggered, so no other filesystem is mounted on it,
   then the call returns a file descriptor referring to the
   automount directory without triggering a mount.

2. https://man7.org/linux/man-pages/man2/open_by_handle_at.2.html

   name_to_handle_at() does not trigger a mount when the final
   component of the pathname is an automount point.  When a
   filesystem supports both file handles and automount points, a
   name_to_handle_at() call on an automount point will return with
   error EOVERFLOW without having increased handle_bytes.  This can
   happen since Linux 4.13 with NFS when accessing a directory which
   is on a separate filesystem on the server.  In this case, the
   automount can be triggered by adding a "/" to the end of the
   pathname.
2022-07-12 22:09:11 +08:00
Kubernetes Prow Robot
29705ce027
Merge pull request #110879 from ping035627/k8s-220630
Handle os.MkdirAll error
2022-07-12 06:06:51 -07:00
Claudiu Belu
7e6e31577e unittests: Adds Windows unittests
Adds unit tests for a few functions that are not covered.
2022-07-08 17:24:15 +03:00
Kubernetes Prow Robot
b3be343bc8
Merge pull request #110811 from Abirdcfly/clock
Update golangci-lint to 1.46.2 and fix errors
2022-07-06 16:03:32 -07:00
Kubernetes Prow Robot
20a7253a0e
Merge pull request #109853 from ping035627/k8s-220506
Cleanup FindPluginBySpec() in VolumePluginMgr
2022-07-01 07:29:22 -07:00
PingWang
1061c4f6d0 Handle os.MkdirAll error
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2022-06-30 16:26:24 +08:00
Abirdcfly
2bca77a3d9 Update golangci-lint to 1.46.2 and fix errors
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-06-29 17:42:46 +08:00
Kubernetes Prow Robot
7a9268d83a
Merge pull request #110719 from xakdwch/master
volume/fc: fix FibreChannel volume plugin matching wrong disks
2022-06-24 03:40:57 -07:00
xakdwch
ddcc448070 volume/fc: fix FibreChannel volume plugin matching wrong disks
Before:
  findDisk()
    fcPathExp := "^(pci-.*-fc|fc)-0x" + wwn + "-lun-" + lun
After:
  findDisk()
    fcPathExp := "^(pci-.*-fc|fc)-0x" + wwn + "-lun-" + lun + "$"

fc path may have the same wwns but different luns.for example:
pci-0000:41:00.0-fc-0x500a0981891b8dc5-lun-1
pci-0000:41:00.0-fc-0x500a0981891b8dc5-lun-12

Function findDisk() may mismatch the fc path, return the wrong device and wrong associated devicemapper parent.
This may cause a disater that pods attach wrong disks. Accutally it happended in my testing environment before.
2022-06-23 16:36:01 +08:00
Jan Safranek
2efe67e3a9 Fix iSCSI over ipv6
Addresses in the Kubernetes API objects (PV, Pod) have `[]` around IPv6
addresses, while addresses in /dev/ and /sys/ have addresses without them.

Add/remove `[]` as needed.
2022-06-22 14:53:01 +02:00
Jiawei Wang
760365d5c9 CSIMigration feature gate to GA 2022-06-06 21:19:19 +00:00
Jonathan Dobson
daa181d92e kubelet: fix volume reconstruction for CSI ephemeral volumes
This resolves a couple of issues for CSI volume reconstruction.
1. IsLikelyNotMountPoint is known not to work for bind mounts and was
   causing problems for subpaths and hostpath volumes.
2. Inline volumes were failing reconstruction due to calling
   GetVolumeName, which only works when there is a PV spec.
2022-06-01 14:22:57 -06:00
Davanum Srinivas
50bea1dad8
Move from k8s.gcr.io to registry.k8s.io
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-05-31 10:16:53 -04:00
Mikko Ylinen
2c8bfad910 grpc: move to use grpc.WithTransportCredentials()
v1.43.0 marked grpc.WithInsecure() deprecated so this commit moves to use
what is the recommended replacement:

grpc.WithTransportCredentials(insecure.NewCredentials())

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-05-30 21:41:47 +03:00
cyclinder
6150737d11 remove feature gate GA for 1.25
Signed-off-by: cyclinder qifeng.guo@daocloud.io
2022-05-12 14:15:23 +08:00
PingWang
bbeec9bbaa Cleanup FindPluginBySpec() in VolumePluginMgr
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2022-05-06 17:21:07 +08:00
Stephen Benjamin
b351745c1c Replace use of Sprintf with net.JoinHostPort
On IPv6 clusters, one of the most frequent problems I encounter is
assumptions that one can build a URL with a host and port simply by
using Sprintf, like this:

```go
fmt.Sprintf("http://%s:%d/foo", host, port)
```

When `host` is an IPv6 address, this produces an invalid URL as it must
be bracketed, like this:

```
http://[2001:4860:4860::8888]:9443
```

This change fixes the occurences of joining a host and port with the
purpose built `net.JoinHostPort` function.

I encounter this problem often enough that I started to [write a linter
for it](https://github.com/stbenjam/go-sprintf-host-port).  I don't
think the linter is quite ready for wide use yet, but I did run it
against the Kube codebase and found these.  While the host portion in
some of these changes may always be an FQDN or IPv4 IP today, it's an
easy thing that can break later on.
2022-05-04 06:37:50 -04:00
Kubernetes Prow Robot
b593ed3118
Merge pull request #109659 from heqg/structuredLog01
Log StructuredLog: spelling formatting
2022-05-04 02:35:34 -07:00
Kubernetes Prow Robot
1aec0c81b1
Merge pull request #105963 from zhucan/bugfix-95367
csi: add nodeExpandSecret support for CSI client & add unit test
2022-05-03 17:17:58 -07:00
Kubernetes Prow Robot
3c5cc15686
Merge pull request #103911 from swiftslee/log-format
Cleanup: use klog.Info in pkg/volume/util/operationexecutor/operation_generator.go
2022-05-03 17:17:32 -07:00
Kubernetes Prow Robot
ea7c57b2ee
Merge pull request #99685 from yangjunmyfm192085/run-test24
Fix misspelling of success.
2022-05-03 17:16:47 -07:00
何庆国10193842
3d14bcb9a4 Log StructuredLog: spelling formatting
Signed-off-by: 何庆国10193842 <he.qingguo@zte.com.cn>
2022-04-26 17:04:06 +08:00
Humble Chirammal
c74b393771 csi: add nodeExpandSecret support for CSI client
CSI spec 1.5 enhanced the spec to add optional secrets field to
NodeExpandVolumeRequest. This commit adds NodeExpandSecret to the
CSI PV source and also derive the expansion secret in csiclient to
send it out as part of the nodeexpand request.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
Signed-off-by: zhucan <zhucan.k8s@gmail.com>
2022-04-05 11:36:23 +08:00
zhucan
eb2ebddf61 fix: add unit test
Signed-off-by: zhucan <zhucan.k8s@gmail.com>
2022-04-05 11:35:14 +08:00
Hemant Kumar
5da524d973 Fix error for inline migrated volumes
Inline migrated volumes report a PV, even though they are not backed
by PV.
2022-04-04 13:14:29 -04:00
Hemant Kumar
6bc8275677 Add node name to NodeExpand events 2022-03-28 12:58:59 -04:00
Hemant Kumar
dee48d3c36 Add more tests for volume recovery cases 2022-03-28 11:59:43 -04:00
Hemant Kumar
a99466ca86 check existing size before querying new size from api-server 2022-03-28 11:32:49 -04:00
Hemant Kumar
ed217f4140 rename SetVolumeSize to InitializeVolumeSize 2022-03-28 11:32:49 -04:00
Hemant Kumar
4d52dbb9f8 Remove legacyCallNodeExpandOnPlugin when RecoverVolumeExpansionFailure 2022-03-28 11:32:49 -04:00
Hemant Kumar
7a43406138 Do not update PVC if it already has updated size 2022-03-28 11:32:49 -04:00
Hemant Kumar
e4f62d6c41 Modify code to use new interface functions 2022-03-28 11:32:49 -04:00
Hemant Kumar
10f91a9951 Refactor volume attach code 2022-03-28 11:32:49 -04:00
Kubernetes Prow Robot
c239b406f0
Merge pull request #108929 from gnufied/move-expansion-feature-gate-ga
Move all volume expansion feature gates to GA
2022-03-25 18:08:16 -07:00
Hemant Kumar
ac6ef262df remove ExpandCSIVolume feature gate 2022-03-24 14:53:00 -04:00
Hemant Kumar
9343cce20b remove ExpandPersistentVolume feature gate 2022-03-24 10:02:47 -04:00
Patrick Ohly
edffc700a4 enhance and fix log calls
Some of these changes are cosmetic (repeatedly calling klog.V instead of
reusing the result), others address real issues:

- Logging a message only above a certain verbosity threshold without
  recording that verbosity level (if klog.V().Enabled() { klog.Info... }):
  this matters when using a logging backend which records the verbosity
  level.

- Passing a format string with parameters to a logging function that
  doesn't do string formatting.

All of these locations where found by the enhanced logcheck tool from
https://github.com/kubernetes/klog/pull/297.

In some cases it reports false positives, but those can be suppressed with
source code comments.
2022-03-24 11:13:50 +01:00
yuswift
7ba2ffb931 pkg/volume: fix incorrect klog.Infof usage
klog.Infof expects a format string as first parameter and then
expands format specifies inside it. What gets passed here
is the final string that must be logged as-is, therefore
klog.Info has to be used.

Signed-off-by: yuswift <yuswift2018@gmail.com>
2022-03-24 16:31:48 +08:00
Kubernetes Prow Robot
2d46f1bc30
Merge pull request #103062 from ikeeip/component_helper_storage
Move volume helpers to "k8s.io/component-helpers/storage/volume".
2022-03-23 13:21:20 -07:00
Kubernetes Prow Robot
aa343fa632
Merge pull request #108628 from RomanBednar/attach-detach-message
csi_attacher: improve attach/detach timeout message
2022-03-16 11:05:15 -07:00
Konstantin Misyutin
4ba98a8610 cleanup: remove unnecessary import aliases 2022-03-16 15:43:09 +08:00
Konstantin Misyutin
1d7cefe9c4 Move volume helpers to "k8s.io/component-helpers/storage/volume".
This patch aims to simplify decoupling "pkg/scheduler/framework/plugins"
from internal "k8s.io/kubernetes" packages. More described in
issue #89930 and PR #102953.

Some helpers from "k8s.io/kubernetes/pkg/controller/volume/persistentvolume"
package moved to "k8s.io/component-helpers/storage/volume" package:

- IsDelayBindingMode
- GetBindVolumeToClaim
- IsVolumeBoundToClaim
- FindMatchingVolume
- CheckVolumeModeMismatches
- CheckAccessModes
- GetVolumeNodeAffinity

Also "CheckNodeAffinity" from "k8s.io/kubernetes/pkg/volume/util"
package moved to "k8s.io/component-helpers/storage/volume" package
to prevent diamond dependency conflict.

Signed-off-by: Konstantin Misyutin <konstantin.misyutin@huawei.com>
2022-03-16 15:43:09 +08:00
Kubernetes Prow Robot
9642a1f84b
Merge pull request #108662 from dobsonj/issue89290
CSI inline volumes should support fsGroup
2022-03-14 09:34:10 -07:00
Roman Bednar
f17f00363b csi_attacher: improve attach/detach timeout message
If we time out waiting for volume to be attached the message given
to user is not informative enough:

"Attach timeout for volume vol-123"

It would be better if we provide more information on what's going on
and even include name of the driver that's causing the problem, e.g.:

"timed out waiting for external-attacher of ebs.csi.aws.com CSI driver to attach volume vol-123"
2022-03-14 11:00:22 +01:00
Jonathan Dobson
88a1962e56 CSI inline volumes should support fsGroup 2022-03-11 16:14:06 -07:00
Hemant Kumar
7fe33bfb7c Remove needless checks for nodestage during expansion 2022-03-10 09:55:06 -05:00
Hemant Kumar
e24219d27b Remove support for previously deprecated nodeExpand call
between staging and publish
2022-03-09 14:50:18 -05:00
Davanum Srinivas
91ade9f318
Switch pv-recycler container image to debian-base
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-03-03 13:37:17 -05:00
Kubernetes Prow Robot
e9ba9dc4e4
Merge pull request #107201 from pacoxu/add-metrics-volume-stats-cal
add VolumeStatCalDuration metrics for fsquato monitoring benchmark
2022-02-28 16:07:46 -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
Kubernetes Prow Robot
eacbf87bfe
Merge pull request #108156 from jsafrane/rename-selinuxsupport
Rename SupportsSELinux to SELinuxRelabel
2022-02-22 20:12:20 -08:00
Kubernetes Prow Robot
37a0b1a321
Merge pull request #108066 from marseel/dont_check_type_in_hostvolule_in_kubemark
Turn off volumehost type check in kubemark clusters
2022-02-18 00:38:24 -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
Kubernetes Prow Robot
4033355d29
Merge pull request #107909 from sebastiansterk/master
🤓 simple grammar fix
2022-02-15 12:15:18 -08:00
Kubernetes Prow Robot
1659924a97
Merge pull request #108070 from jsafrane/remove-selinux
Remove util/selinux package
2022-02-11 18:19:47 -08:00
Kubernetes Prow Robot
1f041ccd54
Merge pull request #107887 from bertinatto/fix-panic-kubelet
Fix panic in Kubelet
2022-02-11 12:58:07 -08:00
Jan Safranek
77aa06d0c8 Remove util/selinux package
The package says:

> the libcontainer SELinux package is only built for Linux, so it is
> necessary to have a NOP wrapper which is built for non-Linux platforms

This is not true, Kubernetes now imports
github.com/opencontainers/selinux/go-selinux and it has proper
multiplatform support (i.e. NOOP on non-Linux platforms).

Removing the whole package and calling go-selinux directly.
2022-02-11 15:20:35 +01:00
Marcel Zięba
66ab60dcf6 Turn off volumehost type check in kubemark clusters 2022-02-11 11:45:33 +00:00
Cheng Xing
b152fa9b6c Remove verult from OWNERS files 2022-02-10 18:25:38 -08:00
Kubernetes Prow Robot
6a5b3da1d8
Merge pull request #107236 from cyclinder/fix_bug_WaitForAttach
GCEPD: fix incorrect return value in WaitForAttach
2022-02-08 09:59:02 -08:00
Hemant Kumar
4b589dfd7a fix flake in detach tests 2022-02-02 17:28:13 -05:00
Sebastian Sterk
8e9ea7b481
simple grammar fix 2022-02-02 00:04:35 +01:00
Fabio Bertinatto
eb2adaa32f Fix panic in Kubelet
Currently, the Kubelet panics when it's started with the
`enable-controller-attach-detach=false` option set and a
volume is attached to a node.

This patch adds a check that prevents the Kubelet from trying to attach
or detach CSI volumes and report a proper error warning the user that this
use case is not supported.
2022-01-31 17:29:25 -03:00
Hemant Kumar
ff765210d5 Mark device as uncertain if unmount device succeeds
If unmount device succeeds but somehow unmount operation
fails because device was in-use elsewhere, we should mark the
device mount as uncertain because we can't use the global
mount point at this point.
2022-01-26 07:49:49 -05:00
Monokaix
96702a89b2 replace filepath.Walk with filepath.WalkDir in doCleanSubPaths 2022-01-25 09:56:32 +08:00
Kubernetes Prow Robot
c175418281
Merge pull request #107065 from saikat-royc/fix-node-stage-path
change node staging path for csi driver to PV agnostic
2022-01-21 01:31:58 -08:00
Saikat Roychowdhury
80e0501e89 change staging path for csi driver to pv agnostic 2022-01-20 22:59:29 +00:00
-e
3967f03bb1 set metric_source to du or fsquota accordingly 2022-01-20 10:56:02 +08:00
Paco Xu
6611c36372 add volume type and seperated histogram for volume stat collection 2022-01-19 22:33:37 +08:00
Kubernetes Prow Robot
874ce66d19
Merge pull request #107279 from NikhilSharmaWe/pathCheck
added devicePath check for fcDisk
2022-01-18 03:05:08 -08:00
Kubernetes Prow Robot
3bd422dc76
Merge pull request #107293 from dims/jan-1-owners-cleanup
Cleanup OWNERS files - Jan 2021 Week 1
2022-01-13 10:30:30 -08:00
Kubernetes Prow Robot
42436c877e
Merge pull request #107462 from dims/next-step-in-csi-migration-for-openstack-take-2
Next step in CSI migration for openstack
2022-01-12 19:57:07 -08:00
Kubernetes Prow Robot
e22ec17057
Merge pull request #99441 from CKchen0726/csi-client
migrate volume/csi/csi-client.go logs to structured logging
2022-01-12 11:52:13 -08:00
Patrick Ohly
9eaa2dc554 avoid klog Info calls without verbosity
In the following code pattern, the log message will get logged with v=0 in JSON
output although conceptually it has a higher verbosity:

   if klog.V(5).Enabled() {
       klog.Info("hello world")
   }

Having the actual verbosity in the JSON output is relevant, for example for
filtering out only the important info messages. The solution is to use
klog.V(5).Info or something similar.

Whether the outer if is necessary at all depends on how complex the parameters
are. The return value of klog.V can be captured in a variable and be used
multiple times to avoid the overhead for that function call and to avoid
repeating the verbosity level.
2022-01-12 07:48:36 +01:00
Davanum Srinivas
7fd97433f0
Next step in CSI migration for openstack
delete/modify tests that use intree cinder as well.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-01-10 22:07:44 -05:00
Davanum Srinivas
9682b7248f
OWNERS cleanup - Jan 2021 Week 1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-01-10 08:14:29 -05:00
Kubernetes Prow Robot
475644ccd8
Merge pull request #106073 from ping035627/k8s-21110202
Cleanup FindPluginByName() in VolumePluginMgr
2022-01-07 07:52:29 -08:00
Nikhil Sharma
4eaa533777 added devicePath check for fcDisk 2022-01-07 20:10:03 +05:30
Kubernetes Prow Robot
d1a5513cb0
Merge pull request #107006 from gnufied/add-total-mount-time-metrics
Add metric for reporting total end-to-end mount time
2022-01-07 06:19:31 -08:00
Hemant Kumar
c9177f3083 rename volume_mount to overall_volume_mount for total metric time 2022-01-06 12:51:05 -05:00
Mengjiao Liu
beda4cafb6 kubelet: Remove the deprecated flag --experimental-check-node-capabilities-before-mount 2022-01-06 11:47:11 +08:00
Kubernetes Prow Robot
31898fc504
Merge pull request #101856 from prateekpandey14/fix-staticcheck
fix static check of importing the same package multiple times
2022-01-05 14:55:47 -08:00
Kubernetes Prow Robot
4f35d80f4e
Merge pull request #107302 from pacoxu/fix/empty-dir-quota-monitoring
assignQuota checks if the underlying medium supports quotas and if so setting it
2022-01-05 09:23:18 -08:00
Kubernetes Prow Robot
0f5e3d14bd
Merge pull request #106421 from houjun41544/20211115-volume
Fix the wrong log
2022-01-04 23:03:05 -08:00
PingWang
075adb308d Cleanup FindPluginByName() in VolumePluginMgr
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update typo

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update import

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2022-01-05 11:42:26 +08:00
Paco Xu
3946e6c8c2 assignQuota checks if the underlying medium supports quotas and if so, sets 2022-01-05 09:33:07 +08:00
cyclinder
3ff8a86f20 GCEPD: fix incorrect return value in WaitForAttach
Signed-off-by: cyclinder <qifeng.guo@daocloud.io>
2021-12-28 09:48:35 +08:00
Kubernetes Prow Robot
f0dbc32ed9
Merge pull request #106853 from gnufied/disable-exp-backoff-volume-not-inuse
When volume is not marked in-use, do not backoff
2021-12-22 19:46:37 -08:00
Hemant Kumar
7989f27044 use node informer to check volumes attachment status before backoff
fix unit tests
2021-12-20 11:57:05 -05:00