empty_dir: Check if hugetlbfs volume is mounted with a correct pagesize

Extended GetMountMedium function to check if hugetlbfs volume
is mounted with the page size equal to the medium size.

Page size is obtained from the 'pagesize' mount option of the
mounted hugetlbfs volume.
This commit is contained in:
Ed Bartosh
2020-02-17 17:21:50 +02:00
parent 882d6e93af
commit 03ecc20b19
4 changed files with 423 additions and 24 deletions

View File

@@ -19,6 +19,7 @@ limitations under the License.
package emptydir
import (
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/utils/mount"
v1 "k8s.io/api/core/v1"
@@ -29,6 +30,6 @@ type realMountDetector struct {
mounter mount.Interface
}
func (m *realMountDetector) GetMountMedium(path string) (v1.StorageMedium, bool, error) {
return v1.StorageMediumDefault, false, nil
func (m *realMountDetector) GetMountMedium(path string, requestedMedium v1.StorageMedium) (v1.StorageMedium, bool, *resource.Quantity, error) {
return v1.StorageMediumDefault, false, nil, nil
}