fix(mount): call sync before/after operations (#288)

* fix(mount): call sync after mount ops

Signed-off-by: mudler <mudler@kairos.io>

* refactor(mount): replace calls wrapped with sync

Signed-off-by: mudler <mudler@kairos.io>

* be consistent

Signed-off-by: mudler <mudler@kairos.io>

* lint fixes

Signed-off-by: mudler <mudler@kairos.io>

---------

Signed-off-by: mudler <mudler@kairos.io>
This commit is contained in:
Ettore Di Giacinto
2024-04-19 12:01:16 +02:00
committed by GitHub
parent 4916e6dba7
commit d14a047aa6
4 changed files with 32 additions and 17 deletions

View File

@@ -17,6 +17,9 @@ type MountOperation struct {
}
func (m MountOperation) Run() error {
// call sync to make sure the data is written to disk
defer internalUtils.Sync()
// Add context to sublogger
l := internalUtils.Log.With().Str("what", m.MountOption.Source).Str("where", m.Target).Str("type", m.MountOption.Type).Strs("options", m.MountOption.Options).Logger()
// Not sure why this defaults to debuglevel when creating a sublogger, so make sure we set it properly