File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 6464 // handle tmpfs mount
6565 let mount_info = get_mount_info ( & m. source ) . await ?;
6666 if let Some ( mi) = mount_info {
67- if mi. fs_type == "tmpfs" {
67+ // Only allow use tmpfs in emptyDir
68+ if mi. fs_type == "tmpfs" && mi. mount_point . contains ( "kubernetes.io~empty-dir" ) {
6869 self . handle_tmpfs_mount ( & id, container_id, m, & mi) . await ?;
6970 return Ok ( ( ) ) ;
7071 }
@@ -317,6 +318,7 @@ where
317318}
318319
319320pub struct MountInfo {
321+ pub mount_point : String ,
320322 pub fs_type : String ,
321323 pub options : Vec < String > ,
322324}
Original file line number Diff line number Diff line change @@ -47,7 +47,11 @@ pub async fn get_mount_info(mount_point: &str) -> Result<Option<MountInfo>> {
4747 if mp == mount_point {
4848 let fs_type = fields[ 2 ] . to_string ( ) ;
4949 let options = fields[ 3 ] . split ( ',' ) . map ( |x| x. to_string ( ) ) . collect ( ) ;
50- return Ok ( Some ( MountInfo { fs_type, options } ) ) ;
50+ return Ok ( Some ( MountInfo {
51+ mount_point : mp,
52+ fs_type,
53+ options,
54+ } ) ) ;
5155 }
5256 }
5357 Ok ( None )
You can’t perform that action at this time.
0 commit comments