mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-11-09 09:27:25 +00:00
Merge pull request #21857 from vrothberg/fix-21849
machine config: make write atomic
This commit is contained in:
commit
2d4ef6f161
1 changed files with 2 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ import (
|
|||
"github.com/containers/podman/v5/pkg/machine/define"
|
||||
"github.com/containers/podman/v5/pkg/machine/lock"
|
||||
"github.com/containers/podman/v5/utils"
|
||||
"github.com/containers/storage/pkg/ioutils"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
|
@ -133,7 +134,7 @@ func (mc *MachineConfig) write() error {
|
|||
return err
|
||||
}
|
||||
logrus.Debugf("writing configuration file %q", mc.configPath.Path)
|
||||
return os.WriteFile(mc.configPath.GetPath(), b, define.DefaultFilePerm)
|
||||
return ioutils.AtomicWriteFile(mc.configPath.GetPath(), b, define.DefaultFilePerm)
|
||||
}
|
||||
|
||||
func (mc *MachineConfig) SetRootful(rootful bool) error {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue