mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-03 18:04:16 +00:00
Merge pull request #2388 from nubificus/fix_jailed_fc
virtcontainers: fc: properly remove jailed block device
This commit is contained in:
@@ -1055,7 +1055,12 @@ func (fc *firecracker) hotplugBlockDevice(ctx context.Context, drive config.Bloc
|
|||||||
fc.umountResource(driveID)
|
fc.umountResource(driveID)
|
||||||
// use previous raw file created at createDiskPool, that way
|
// use previous raw file created at createDiskPool, that way
|
||||||
// the resource is released by firecracker and it can be destroyed in the host
|
// the resource is released by firecracker and it can be destroyed in the host
|
||||||
path = filepath.Join(fc.jailerRoot, driveID)
|
if fc.jailed {
|
||||||
|
// use path relative to the jail
|
||||||
|
path = filepath.Join("/", driveID)
|
||||||
|
} else {
|
||||||
|
path = filepath.Join(fc.jailerRoot, driveID)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, fc.fcUpdateBlockDrive(ctx, path, driveID)
|
return nil, fc.fcUpdateBlockDrive(ctx, path, driveID)
|
||||||
|
Reference in New Issue
Block a user