Commit graph

934 commits

Author SHA1 Message Date
Kubernetes Prow Robot
40dab40837
Merge pull request #138856 from RomanBednar/handle-corrupted-subpath-mount
Handle corrupted subpath mount points during container restart
2026-06-03 20:49:51 +05:30
Kubernetes Prow Robot
66904291e8
Merge pull request #134540 from dddddai/subpath
Fix a race condition when creating subPath directories
2026-05-30 12:08:46 +05:30
Anish Ramasekar
c94c28c183
feat(volume): add IsRemount to MounterArgs
Thread the reconciler's existing isRemount signal into MounterArgs so
volume plugins can distinguish an initial publish from a republish
(e.g. CSIDriver.spec.requiresRepublish=true). No behavior change.
2026-05-13 11:49:54 -07:00
Roman Bednar
5e8587c380 kubelet: Handle corrupted subpath mount points during container restart
When a container using an NFS-backed volume (e.g. AWS EFS via the EFS
CSI driver) with subPathExpr is killed, kubelet may fail to restart it
with CreateContainerConfigError and "stale NFS file handle" because the
subpath bind mount target holds a cached NFS4 file handle that has been
invalidated server-side. IsMountPoint() calls lstat() on the target,
gets ESTALE, and prepareSubpathTarget() treats it as a hard failure. The
pod becomes permanently stuck and requires manual intervention.

The subpath teardown path was already hardened against stale NFS handles
in kubernetes/kubernetes#71804 (doCleanSubPaths), but the setup path in
prepareSubpathTarget() was never updated.

Detect corrupted mount points using mount.IsCorruptedMnt() and unmount
the stale bind mount before proceeding to re-create it.

Ref: https://github.com/kubernetes-sigs/aws-efs-csi-driver/issues/614
Ref: https://redhat.atlassian.net/browse/OCPBUGS-84229
2026-05-12 15:46:38 +02:00
Roman Bednar
bdca200430 kubelet: Do not use deprecated function for checking mount point
mount.IsNotMount point has been deprecated and mounter.IsMountPoint
is now preffered.

This small refactor if prepareSubpathTarget() should not pose any
risk because IsNotMountPoint directly calls IsMountPoint and just
returns its negated value.
2026-05-12 15:46:37 +02:00
Prathamesh Bhope
610e615b35 Promote volume metrics to beta and strengthen the tests 2026-05-05 10:48:17 -07:00
zak905
04286814e7 clean up: remove loop variable capture 2026-04-28 23:53:27 +02:00
Kubernetes Prow Robot
7f19b73805
Merge pull request #138154 from humblec/update-metrics-server-v0.8.1
metrics-server: update to v0.8.1 and fix stale RBAC resourceName
2026-04-25 18:22:45 +05:30
Humble Devassy Chirammal
4964f699db metrics-server: update to v0.8.1 and fix stale RBAC resourceName
Update metrics-server addon from v0.8.0 to v0.8.1.

Also fix the ClusterRole resource-reader which still referenced the
deployment name from v0.7.1 (metrics-server-v0.7.1). The addon-resizer
nanny needs get/patch permission on the current deployment name to
function correctly; without this fix the nanny requests would be
denied by RBAC.

Additionally update the README link from the archived
kubernetes-incubator org to the current kubernetes-sigs org.

Signed-off-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
2026-04-02 20:29:25 +05:30
Humble Devassy Chirammal
2cb9fdf578 volume: fix incorrect error and log messages across volume plugins
Fix several incorrect error and log messages in volume plugins that
produce confusing or incomplete output during troubleshooting:

- Fix "MountMount.NodeExpandVolume" to "MountVolume.NodeExpandVolume"
  in node_expander.go (2 occurrences)
- Fix "MountVolume.NodeExapndVolume" to "MountVolume.NodeExpandVolume"
  in node_expander.go and operation_generator.go (2 occurrences)
- Fix iscsi mkdir error log that prints literal "error" instead of the
  actual error value
- Fix "error ummounting" to "error unmounting" in subpath handling
- Fix malformed "with :" in teardown error messages in configmap,
  secret, projected, and downwardapi volume plugins
- Fix duplicated "is is" in operation_generator.go comment

Signed-off-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
2026-04-02 14:31:47 +05:30
Kubernetes Prow Robot
2f9c2462f7
Merge pull request #137332 from gavinkflam/fix-projected-token-link-file-owner-uid
bug: Fix link file ownership of projected serviceAccountToken
2026-03-10 19:29:11 +05:30
Jordan Liggitt
45900a1deb
Fix vet error 2026-03-05 18:11:02 -05:00
Kubernetes Prow Robot
8275484dcf
Merge pull request #137297 from atombrella/feature/pkg_forvar_modernize
Remove redundant variable re-assignment in for-loops under pkg
2026-03-05 00:28:20 +05:30
Mads Jensen
f11bb48738 Remove redundant re-assignment in for-loops under pkg
This the forvar rule from modernize. The semantics of the for-loop
changed from Go 1.22 to make this pattern obsolete.
2026-03-02 08:47:43 +01:00
Gavin Lam
e5920df4da
bug: Fix link file ownership of projected serviceAccountToken
Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>
2026-03-01 15:22:09 -05:00
Daniel Fajmon
b0919d81a0 Promote SELinuxChangePolicy & SELinuxMountReadWriteOncePod to GA 2026-02-27 14:58:14 +01:00
Kubernetes Prow Robot
4f87013946
Merge pull request #136330 from atombrella/feature/modernize_slicescontains
Simplify pkg/volume with slices.Contains.
2026-02-20 03:31:38 +05:30
Stephen Kitt
d42d1e3d1f
Deprecate obsolete slice utility functions
... and update users to use standard library functions.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-02-16 10:04:33 +01:00
Mads Jensen
066b00667a volume: simplify elem check with slices.Contains. 2026-02-05 14:47:40 +01:00
张可10140699
bd7c78107f Fix:NewUnmounter always returns error while deleting pod after node reboot 2026-02-02 10:55:01 +08:00
hongkang
6910bc7bb0 Fix VolumeAttachment cleanup when AttachRequired changes
When CSI's AttachRequired changes from true to false after a successful
volume attach, MarkVolumeAsAttached fails because it attempts to look up
the plugin by spec, which fails verification.
This patch passes the VolumeName directly to MarkVolumeAsAttached.
This allows the function to skip the plugin lookup and correctly mark
the volume as attached in the Actual State of World, ensuring
VolumeAttachment cleanup can proceed.

Signed-off-by: hongkang <mzhkcj50@gmail.com>
2025-12-19 15:51:45 +08:00
Patrick Ohly
ad79e479c2 build: remove deprecated '// +build' tag
This has been replaced by `//build:...` for a long time now.

Removal of the old build tag was automated with:

    for i in $(git grep -l '^// +build' | grep -v -e '^vendor/'); do if ! grep -q '^// Code generated' "$i"; then sed -i -e '/^\/\/ +build/d' "$i"; fi; done
2025-12-18 12:16:21 +01:00
Kubernetes Prow Robot
1187749524
Merge pull request #133719 from carlory/removeMaxAttachLimit
clean up removeMaxAttachLimit
2025-12-17 16:25:40 -08:00
carlory
8be985d4fa
kubelet: fix concurrent map write error when creating a pod with empty volumes when the LocalStorageCapacityIsolationFSQuotaMonitoring feature-gate is enabled 2025-11-06 16:23:04 +08:00
dddddai
4bab051f61 Fix a race condition when creating subPath directories 2025-10-11 20:27:08 +08:00
Humble Devassy Chirammal
c4ec18b58a pkg/volume: improve code style and readability
- Improve slice declaration formatting in quota_common_linux_impl.go
- Enhance variable naming clarity (myMPSlash -> myMountPointWithSlash)
- Standardize function comment format for consistency
- Add trailing comma to slice declarations following Go conventions

These are non-breaking  improvements that enhance code
readability and maintain consistency with Go best practices.

Signed-off-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
2025-09-27 20:18:08 +05:30
Humble Devassy Chirammal
ad8f91fb0f Fix error messages in volume path handler
Signed-off-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
2025-09-25 22:37:03 +05:30
Kubernetes Prow Robot
ef4add4509
Merge pull request #133356 from mayuka-c/issue-133175
Replace usage of deprecated ErrWaitTimeout with recommended method across all Pkgs
2025-09-05 06:43:34 -07:00
huweiwen
4abd40f6e3 kubelet: multiple volumes reference one PVC in one Pod
Previously, pod with multiple volumes references one PVC is stuck at
ContainerCreating without any error message.
Fixing this by storing multiple OuterVolumeSpecNames per volume
2025-08-28 13:05:07 +08:00
huweiwen
7910cbb884 kubelet/volumeManager: remove outerVolumeSpecName from ASW 2025-08-28 13:05:06 +08:00
huweiwen
146f0c9345 remove MountedVolume.OuterVolumeSpecNames from logs 2025-08-28 13:05:06 +08:00
carlory
2f3e6778ff
clean up removeMaxAttachLimit 2025-08-27 10:58:47 +08:00
Mayuka Channankaiah
6c56d2fd1b Replace usage of deprecated ErrWaitTimeout with recommended method across all Pkgs 2025-08-01 14:18:06 +05:30
Eddie
727a6e6db5
Reject pod when attachment limit is exceeded (#132933)
* Reject pod when attachment limit is exceeded

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Record admission rejection

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Fix pull-kubernetes-linter-hints

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Fix AD Controller unit test failure

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Consolidate error handling logic in WaitForAttachAndMount

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Improve error context

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Update admissionRejectionReasons to include VolumeAttachmentLimitExceededReason

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Update status message

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Add TestWaitForAttachAndMountVolumeAttachLimitExceededError unit test

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Add e2e test

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Fix pull-kubernetes-linter-hints

Signed-off-by: Eddie Torres <torredil@amazon.com>

---------

Signed-off-by: Eddie Torres <torredil@amazon.com>
2025-07-24 17:58:54 -07:00
Hemant Kumar
c126870ebc Bump RecoverVolumeExpansionFailure to GA 2025-07-10 12:19:31 -04:00
Kubernetes Prow Robot
e12f5490cb
Merge pull request #128429 from liyuerich/volumepathhandler
add UT for volumepathhandler
2025-07-07 08:41:25 -07:00
Kubernetes Prow Robot
f407bd6d24
Merge pull request #132254 from carlory/cleanup-MountContainers
Cleanup after Alpha feature MountContainers was removed
2025-06-18 17:24:50 -07:00
Kubernetes Prow Robot
2689185671
Merge pull request #131542 from carlory/volume-limit-e2e
e2e tests: fix in-tree plugin volume limit
2025-06-17 15:40:50 -07:00
carlory
85bc3cb096 Remove GetExec method from VolumeHost
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-06-13 10:58:37 +08:00
carlory
f0dde38234 Remove pluginName param from GetMounter and GetExec
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-06-12 17:29:17 +08:00
Hemant Kumar
96b5ae792b Add code for not expanding volume if it has NodeExpansionNotRequired annotation 2025-05-28 13:07:34 -04:00
Hemant Kumar
4654496c39 Add code to not expand certain types of volumes 2025-05-28 10:22:35 -04:00
liyuerich
1ce8503e91 add UT for volumepathhandler
Signed-off-by: liyuerich <yue.li@daocloud.io>
2025-05-20 16:47:42 +08:00
Hemant Kumar
5da12b5aee Add tests that validate the return value of resize operation 2025-05-16 08:16:24 -04:00
carlory
4d5d48da70 Remove unused volume limit constants 2025-04-30 13:41:27 +08:00
Kubernetes Prow Robot
1f056f8f88
Merge pull request #131495 from carlory/fix-131381
Handle unsupported node expansion for RWX volumes
2025-04-28 10:39:54 -07:00
carlory
dddfeb4a0e Handle unsupported node expansion for RWX volumes
Co-authored-by: Hemant Kumar <gnufied@users.noreply.github.com>
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-04-29 00:19:47 +08:00
Kubernetes Prow Robot
375f282985
Merge pull request #131408 from gnufied/remove-unknown-resizing-error
Remove warning about resizing failed for unknown reason
2025-04-25 09:41:24 -07:00
Hemant Kumar
1db2d6a018 Mark NodeExpansion finsihed without featuregate check 2025-04-23 16:15:10 -04:00
Hemant Kumar
70ebe90b13 Also change final status by removing featuregate check 2025-04-23 16:05:56 -04:00