mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-08 12:54:05 +00:00
sandbox-bindmount: persist mount information
Without this, if the shim dies, we will not have a reliable way to
identify what mounts should be cleaned up if `containerd-shim-kata-v2
cleanup` is called for the sandbox.
Before this, if you `ctr run` with a sandbox bindmount defined and SIGKILL the
containerd-shim-kata-v2, you'll notice the sandbox bindmount left on
host.
With this change, the shim is able to get the sandbox bindmount
information from disk and do the appropriate cleanup.
Fixes #1896
Signed-off-by: Eric Ernst <eric_ernst@apple.com>
(cherry picked from commit 7f1030d303
)
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
This commit is contained in:
parent
b137c7ac33
commit
c51891fee7
@ -191,6 +191,8 @@ func (s *Sandbox) dumpConfig(ss *persistapi.SandboxState) {
|
|||||||
Cgroups: sconfig.Cgroups,
|
Cgroups: sconfig.Cgroups,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ss.Config.SandboxBindMounts = append(ss.Config.SandboxBindMounts, sconfig.SandboxBindMounts...)
|
||||||
|
|
||||||
for _, e := range sconfig.Experimental {
|
for _, e := range sconfig.Experimental {
|
||||||
ss.Config.Experimental = append(ss.Config.Experimental, e.Name)
|
ss.Config.Experimental = append(ss.Config.Experimental, e.Name)
|
||||||
}
|
}
|
||||||
@ -459,6 +461,7 @@ func loadSandboxConfig(id string) (*SandboxConfig, error) {
|
|||||||
DisableGuestSeccomp: savedConf.DisableGuestSeccomp,
|
DisableGuestSeccomp: savedConf.DisableGuestSeccomp,
|
||||||
Cgroups: savedConf.Cgroups,
|
Cgroups: savedConf.Cgroups,
|
||||||
}
|
}
|
||||||
|
sconfig.SandboxBindMounts = append(sconfig.SandboxBindMounts, savedConf.SandboxBindMounts...)
|
||||||
|
|
||||||
for _, name := range savedConf.Experimental {
|
for _, name := range savedConf.Experimental {
|
||||||
sconfig.Experimental = append(sconfig.Experimental, *exp.Get(name))
|
sconfig.Experimental = append(sconfig.Experimental, *exp.Get(name))
|
||||||
|
@ -275,6 +275,9 @@ type SandboxConfig struct {
|
|||||||
|
|
||||||
DisableGuestSeccomp bool
|
DisableGuestSeccomp bool
|
||||||
|
|
||||||
|
// SandboxBindMounts - list of paths to mount into guest
|
||||||
|
SandboxBindMounts []string
|
||||||
|
|
||||||
// Experimental enables experimental features
|
// Experimental enables experimental features
|
||||||
Experimental []string
|
Experimental []string
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user