Commit Graph

819 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
4cc989a7a9 Merge pull request #124740 from bells17/use-sets-set-string
[pkg/volume] Changed to use sets.Set[string] instead of sets.String
2024-05-31 05:32:15 -07:00
carlory
3812fa1d6d Fix kubelet on Windows fails if a pod has SecurityContext with RunAsUser.
Co-authored-by: rphillips <rphillips@redhat.com>
2024-05-23 12:44:51 +08:00
Kubernetes Prow Robot
60ca8489be Merge pull request #124790 from carlory/cleanup-volume-cluster
Remove clusterName from VolumeOptions
2024-05-15 17:23:12 -07:00
carlory
21baa25e1a remove BulkVolumeVerifier interface from volume 2024-05-14 14:17:25 +08:00
bells17
8cf18d1b5c [pkg/volume] Changed to use sets.Set[string] instead of sets.String 2024-05-11 18:02:45 +09:00
carlory
9c92b37d4e remove clusterName from VolumeOptions 2024-05-10 16:42:31 +08:00
Marek Siarkowicz
3ee8178768 Cleanup defer from SetFeatureGateDuringTest function call 2024-04-24 20:25:29 +02:00
Kubernetes Prow Robot
1646f2cfdb Merge pull request #124015 from carlory/cleanup-ephemeral
Visit ephemeral containers when calculating fs user
2024-04-18 02:11:20 -07:00
carlory
dd2dcabe5b Visit ephemeral containers when calculating fs user 2024-03-21 14:31:37 +08:00
carlory
b47c73ee26 keep-terminated-pod-volumes flag on kubelet is removed 2024-03-01 18:42:15 +08:00
Kubernetes Prow Robot
f139450e9b Merge pull request #122885 from claudiubelu/unittests-10
unittests: Fixes unit tests for Windows (part 10)
2024-02-28 05:38:40 -08:00
Jan Safranek
d7028a8ed5 Add SELinuxMount feature gate
The feature gate enables mounting with -o context=XYZ mount option for all
volume types, not only ReadWriteOncePod.

All SELinux label tracking & error reporting infrastructure is already in
place from SELinuxMountReadWriteOncePod feature gate. This is just a
trivial extension to all access modes.
2024-02-20 15:40:21 +01:00
Kubernetes Prow Robot
2c5105e7b8 Merge pull request #123032 from carlory/fix-122960
fix GenerateUnmapVolumeFunc missing globalUnmapPath
2024-02-02 05:39:03 -08:00
Hemant Kumar
d190fa3e7d Fix race condition between external-resizer and kubelet
This fixes the race condition that could happen because
resize controller just finished volume expansiona and has only
finished marking PV and yet to mark PVC.

The workaround proposed here should not be necessary once
RecoverVolumeExpansionFailure goes GA/beta.
2024-01-31 12:23:56 -05:00
Kubernetes Prow Robot
fedb5842e5 Merge pull request #122807 from carlory/fix-121472
Fix AtomicWriter may not create user visible files after kubelet was restarted
2024-01-30 04:19:26 -08:00
carlory
77fed9d2b7 fix GenerateUnmapVolumeFunc missing globalUnmapPath when kubelet tries to clean up all volumes that failed reconstruction. 2024-01-30 17:29:54 +08:00
Kubernetes Prow Robot
56ee53faf5 Merge pull request #110601 from claudiubelu/path-filepath-update
Replaces path.Operation with filepath.Operation
2024-01-29 06:49:26 -08:00
Kubernetes Prow Robot
bb3030bf0e Merge pull request #121995 from carlory/fix-getDeviceNameFromMount
fix incorrect getDeviceNameFromMount comment
2024-01-29 05:40:53 -08:00
carlory
35004e8f77 Fix AtomicWriter may not create user visible files after kubelet was restarted 2024-01-23 22:14:40 +08:00
Claudiu Belu
b8df7e7684 unittests: Fixes unit tests for Windows (part 10)
Currently, there are some unit tests that are failing on
Windows due to various reasons:

- Different "File not found" error messages on Windows.
- Files need to be closed on Windows before removing them.
- The default RootHnsEndpointName (root-hnsendpoint-name) flag value is 'cbr0'
- On Windows, Unix Domain sockets are not checked in the same way in golang, which is why
  hostutils_windows.go checks for it differently. GetFileType will return an error in this
  case. We need to check for it, and see if it's actually a Unix Domain Socket.
2024-01-22 13:43:42 +00:00
Claudiu Belu
c65d9e4d59 Replaces path.Operation with filepath.Operation
The path module has a few different functions:
Clean, Split, Join, Ext, Dir, Base, IsAbs. These functions do not
take into account the OS-specific path separator, meaning that they
won't behave as intended on Windows.

For example, Dir is supposed to return all but the last element of the
path. For the path "C:\some\dir\somewhere", it is supposed to return
"C:\some\dir\", however, it returns ".".

Instead of these functions, the ones in filepath should be used instead.
2024-01-15 20:35:13 +00:00
Kubernetes Prow Robot
d250588077 Merge pull request #121825 from carlory/clean-113
remove duplicated check in operator_generator.go
2024-01-05 16:52:13 +01:00
carlory
5607349e39 remove wrong warning event (FileSystemResizeFailed) during a pod creation when it uses a readonly volume. 2023-12-28 17:49:02 +08:00
Hemant Kumar
e706b6ba14 Use a separate function for checking if device was reconstructed 2023-12-14 11:37:47 -05:00
Hemant Kumar
56dd5ab10f Add tests for checking of uncertain device paths 2023-12-11 17:15:16 -05:00
Hemant Kumar
ed0facacfa Fix device uncertain errors on reboot 2023-12-06 22:19:14 -05:00
carlory
c494e8b18e fix incorrect getDeviceNameFromMount comment 2023-11-23 16:36:44 +08:00
carlory
407b9d9610 remove duplicated check in operator_generator.go 2023-11-09 15:38:49 +08:00
carlory
ae90a69677 volumeattributesclass and core api changes 2023-10-31 11:18:56 +08:00
Chris Henzie
2dbd405583 Graduate ReadWriteOncePod to GA 2023-10-20 10:40:39 -07:00
Kubernetes Prow Robot
7824ac0f3e Merge pull request #114336 from claudiubelu/fixes-test-get-file-type
unittests: Fixes hostutil.GetFileType for Windows
2023-10-17 20:07:39 +02:00
Jan Safranek
7fc11f47ff Mark a volume as uncertain-attached after detach error
Volume that failed Detach() should not be marked as attached, CSI
external-attacher is probably still trying to detach it.

Mark it uncertain instead and wait for Detach() to succeed.
2023-09-13 10:03:28 +02:00
Kubernetes Prow Robot
42357dd257 Merge pull request #120128 from ritazh/format-mount
Use environment variables for parameters in Powershell
2023-08-23 10:40:01 -07:00
James Sturtevant
2bede058f9 Use environment varaibles for parameters in Powershell
As a defense in depth, pass parameters to powershell via environment variables.

Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-08-23 05:57:46 -07:00
James Sturtevant
c761c16562 Use env varaibles for passing path
The subpath could be passed a powershell subexpression which would be executed by kubelet with privilege.  Switching to pass the arguments via environment variables means the subexpression won't be evaluated.

Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-08-23 05:57:11 -07:00
Kubernetes Prow Robot
9aba98ad71 Merge pull request #119948 from liyuerich/storageclass
add UT for storageclass
2023-08-22 10:03:06 -07:00
Patrick Ohly
2472291790 api: introduce separate VolumeResourceRequirements struct
PVC and containers shared the same ResourceRequirements struct to define their
API. When resource claims were added, that struct got extended, which
accidentally also changed the PVC API. To avoid such a mistake from happening
again, PVC now uses its own VolumeResourceRequirements struct.

The `Claims` field gets removed because risk of breaking someone is low:
theoretically, YAML files which have a claims field for volumes now
get rejected when validating against the OpenAPI. Such files
have never made sense and should be fixed.

Code that uses the struct definitions needs to be updated.
2023-08-21 15:31:28 +02:00
liyuerich
a6a1f070e7 Signed-off-by: liyuerich <yue.li@daocloud.io>
add UT for storageclass
2023-08-18 22:18:11 +08:00
Hemant Kumar
2e217e8cea Reduce duplication between helpers for checking featuregate 2023-07-17 15:34:45 -04:00
Hemant Kumar
f01a1faa8c Update comments about allocatedResourceStatus
Update API types with more comments
2023-07-17 15:30:36 -04:00
Hemant Kumar
e011187114 Update code to use new generic allocatedResourceStatus field 2023-07-17 15:30:35 -04:00
Kubernetes Prow Robot
52457842d1 Merge pull request #117055 from cyclinder/csi_migration
remove CSI-migration gate
2023-06-28 04:28:31 -07:00
Kubernetes Prow Robot
a48bcc06fe Merge pull request #117064 from RomanBednar/multiple-defaults
storage class assignment should not ignore errors
2023-06-23 03:09:23 -07:00
Stephen Kitt
ab75e48494 storage: stop using deprecated io/ioutil
This replaces deprecated ioutil variables and functions as follows:

* ioutil.ReadDir -> os.ReadDir
* ioutil.ReadFile -> os.ReadFile
* ioutil.TempDir -> os.MkdirTemp
* ioutil.TempFile -> os.CreateTemp
* ioutil.WriteFile -> os.WriteFile

The ReadDir conversion involves an API change, the replacement
function returns a slice of fs.DirEntry instead of fs.FileInfo.
Where appropriate, the surrounding code has been adjusted; mostly,
that means using DirEntry.Type() instead of FileInfo.Mode().
Applying this change to the IoUtil interface would mean changing its
API, so this is left for later.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-06-20 16:49:03 +02:00
cyclinder
8e4228a8c1 remove CSI-migration gate 2023-06-04 18:40:17 +08:00
Claudiu Belu
b4d1440063 unittests: Fixes hostutil.GetFileType for Windows
GetFileType is meant to return the type of the given file by using os.Stat.
However, os.Stat doesn't work on Windows for Unix Sockets, causing an error to occur:

[2-Socket Test] unexpected error :
CreateFile C:\Users\Administrator\AppData\Local\Temp\test-get-filetype-2776877299\mt.sock:
The file cannot be accessed by the system.

This is a known issue and we're already using a workaround for this in
pkg/kubelet/util/util_windows.go.

This commit fixes this issue for GetFileType on Windows.
2023-06-01 16:02:07 +00:00
Kubernetes Prow Robot
189fe3f3e6 Merge pull request #114806 from qingwave/fix-volume-util
fix typo in volume util
2023-05-18 08:32:34 -07:00
Kubernetes Prow Robot
347480b0c6 Merge pull request #117099 from UiPath/fix-qos-limit
kubelet: fix setup of emptyDir with sizeLimit (fsquota)
2023-04-11 20:21:10 -07:00
Kubernetes Prow Robot
4893c66a48 Merge pull request #116134 from cvvz/fix-111933
fix: After a Node is down and take some time to get back to up again, the mount point of the evicted Pods cannot be cleaned up successfully.
2023-04-11 15:35:41 -07:00
Alexandru Matei
c77ad3116f kubelet: fix setup of emptyDir with sizeLimit (fsquota)
When size limit is specified subsequent invocations will fail because
ibytes is changed to -1 and stored internally in quotaSizeMap during the
first call.  Later invocation will see that the requested size doesn't
match the actual stored value and it will fail.

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2023-04-07 11:07:51 +03:00