When in transient store mode, use rundir for bundlepath
This means we store things like config.json and the secret files also on tmpfs, lowering wear on disk and leaving less stuff on disk on an unclean shutdown. Signed-off-by: Alexander Larsson <alexl@redhat.com>
This commit is contained in:
parent
90ba443472
commit
3808067ff8
|
@ -128,6 +128,9 @@ func (c *Container) rwSize() (int64, error) {
|
|||
// bundlePath returns the path to the container's root filesystem - where the OCI spec will be
|
||||
// placed, amongst other things
|
||||
func (c *Container) bundlePath() string {
|
||||
if c.runtime.storageConfig.TransientStore {
|
||||
return c.state.RunDir
|
||||
}
|
||||
return c.config.StaticDir
|
||||
}
|
||||
|
||||
|
|
|
@ -118,6 +118,7 @@ func TestPostDeleteHooks(t *testing.T) {
|
|||
statePath := filepath.Join(dir, "state")
|
||||
copyPath := filepath.Join(dir, "copy")
|
||||
c := Container{
|
||||
runtime: &Runtime{},
|
||||
config: &ContainerConfig{
|
||||
ID: "123abc",
|
||||
Spec: &rspec.Spec{
|
||||
|
|
Loading…
Reference in New Issue