mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #52338 from PiotrProkop/fix-hugepages
Automatic merge from submit-queue (batch tested with PRs 51041, 52297, 52296, 52335, 52338) Fix pagesize mount option name **What this PR does / why we need it**: Fixes #52337 .
This commit is contained in:
commit
b05d8ad1ec
@ -55,6 +55,7 @@ var _ volume.VolumePlugin = &emptyDirPlugin{}
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
emptyDirPluginName = "kubernetes.io/empty-dir"
|
emptyDirPluginName = "kubernetes.io/empty-dir"
|
||||||
|
hugePagesPageSizeMountOption = "pagesize"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getPath(uid types.UID, volName string, host volume.VolumeHost) string {
|
func getPath(uid types.UID, volName string, host volume.VolumeHost) string {
|
||||||
@ -321,7 +322,7 @@ func getPageSizeMountOptionFromPod(pod *v1.Pod) (string, error) {
|
|||||||
return "", fmt.Errorf("hugePages storage requested, but there is no resource request for huge pages.")
|
return "", fmt.Errorf("hugePages storage requested, but there is no resource request for huge pages.")
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Sprintf("pageSize=%s", pageSize.String()), nil
|
return fmt.Sprintf("%s=%s", hugePagesPageSizeMountOption, pageSize.String()), nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ func TestGetHugePagesMountOptions(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
shouldFail: false,
|
shouldFail: false,
|
||||||
expectedResult: "pageSize=2Mi",
|
expectedResult: "pagesize=2Mi",
|
||||||
},
|
},
|
||||||
"testWithProperValuesAndDifferentPageSize": {
|
"testWithProperValuesAndDifferentPageSize": {
|
||||||
pod: &v1.Pod{
|
pod: &v1.Pod{
|
||||||
@ -347,7 +347,7 @@ func TestGetHugePagesMountOptions(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
shouldFail: false,
|
shouldFail: false,
|
||||||
expectedResult: "pageSize=1Gi",
|
expectedResult: "pagesize=1Gi",
|
||||||
},
|
},
|
||||||
"InitContainerAndContainerHasProperValues": {
|
"InitContainerAndContainerHasProperValues": {
|
||||||
pod: &v1.Pod{
|
pod: &v1.Pod{
|
||||||
@ -371,7 +371,7 @@ func TestGetHugePagesMountOptions(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
shouldFail: false,
|
shouldFail: false,
|
||||||
expectedResult: "pageSize=1Gi",
|
expectedResult: "pagesize=1Gi",
|
||||||
},
|
},
|
||||||
"InitContainerAndContainerHasDifferentPageSizes": {
|
"InitContainerAndContainerHasDifferentPageSizes": {
|
||||||
pod: &v1.Pod{
|
pod: &v1.Pod{
|
||||||
|
Loading…
Reference in New Issue
Block a user