Commit graph

913 commits

Author SHA1 Message Date
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
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
Hemant Kumar
0e40ed642b Check for newer fields when deciding expansion recovery feature status 2025-04-23 11:37:22 -04:00
Hemant Kumar
90de4b5894 Remove warning about resizing failed for unknown reason 2025-04-22 10:30:51 -04:00
Eddie Torres
c766a52356
Implement KEP 4876 Mutable CSINode (#130007)
* Implement KEP-4876 Mutable CSINode Allocatable Count

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

* Update TestGetNodeAllocatableUpdatePeriod

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

* Implement CSINodeUpdater

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

* Use sync.Once in csiNodeUpdater

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

* ImVerify driver is installed before running periodic updates

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

* Update NodeAllocatableUpdatePeriodSeconds type comment

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

* Leverage apivalidation.ValidateImmutableField in ValidateCSINodeUpdate

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

* Update strategy functions

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

* Run hack/update-openapi-spec.sh

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

* Update VolumeError.ErrorCode field

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

* CSINodeUpdater improvements

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

* Iron out concurrency in syncDriverUpdater

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

* Run hack/update-openapi-spec.sh

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

* Revise logging

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

* Revise log in VerifyExhaustedResource

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

* Update API validation

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

* Add more code coverage

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

* Fix pull-kubernetes-linter-hints

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

* Update API types documentation

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

* Update strategy and validation for new errorCode field

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

* Update validation tests after strategy changes

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

* Update VA status strategy

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

---------

Signed-off-by: torredil <torredil@amazon.com>
2025-03-18 12:45:49 -07:00
Kubernetes Prow Robot
6b8341fc2e
Merge pull request #130544 from jsafrane/selinux-beta
selinux: Promote SELinuxChangePolicy and SELinuxMount to beta
2025-03-12 11:29:47 -07:00
Mark Rossetti
20230f2251
Fixing unit tests in k8s.io/kubernetes/pkg/volume/util/subpath on Windows 2025-03-06 13:05:48 -08:00
Jan Safranek
96bae53a37 Promote SELinuxChangePolicy and SELinuxMount to beta
SELinuxMount stays off by default, because it changes the default
kubelet behavior. SELinuxChangePolicy is on by default and notifies users
on Pods that could get broken by SELinuxMount feature gate.
2025-03-04 11:03:54 +01:00
Hemant Kumar
b51cbb1d17 Change plugin interfaces to use progress monitoring 2025-02-24 15:55:37 -05:00
Hemant Kumar
32752fe395 Add recommendation for using OnRootMismatch 2025-02-24 15:55:37 -05:00
Hemant Kumar
49dabe56d0 Monitor progress tracking for permission change 2025-02-24 15:55:37 -05:00
mansikulkarni96
237aadab89
[hostutil_windows] Remove unix workaround 2025-02-21 18:02:28 -05:00
Kubernetes Prow Robot
b84cb65f93
Merge pull request #129370 from andyzhangx/adopt-go1.23-behavior-change
fix: adopt go1.23 behavior change in mount point parsing on Windows#2
2025-02-21 12:50:26 -08:00
andyzhangx
bb49a05fb5 fix: adopt go1.23 behavior change in mount point parsing on Windows
fix comments
2025-02-18 07:17:51 +00:00
Kubernetes Prow Robot
e69a5ed9b3
Merge pull request #129200 from carlory/remove-GetDeviceNameFromMount
Remove GetDeviceNameFromMount from HostUtils
2025-01-20 10:00:35 -08:00
carlory
d3974065c8 Remove GetDeviceNameFromMount from HostUtils
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-01-18 21:23:54 +08:00
carlory
977c4e9138 remove nsenter package 2025-01-03 12:09:29 +08:00
Kubernetes Prow Robot
e8615e2712
Merge pull request #129054 from pohly/remove-import-name
remove import doc comments
2024-12-12 09:58:35 +01:00
Kubernetes Prow Robot
5948c7b5a9
Merge pull request #128086 from RomanBednar/fix-wwn-fc-matching
prevent unnecessary resolving of iscsi/fc devices to dm
2024-12-12 02:57:13 +00:00
Patrick Ohly
8a908e0c0b remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".
2024-12-02 16:59:34 +01:00
Kubernetes Prow Robot
7667a68b72
Merge pull request #128383 from carlory/cleanup-codes
remove csi translator from volume operation generator
2024-11-07 13:47:46 +00:00
Kubernetes Prow Robot
f3498df864
Merge pull request #128522 from huww98/multi-volume-part-0
Cleanups about kubelet/volumemanager
2024-11-07 03:53:28 +00:00
Jan Safranek
8875f4daf0 Describe what the input list of SELinux options is 2024-11-06 11:16:06 +01:00