more debug

Signed-off-by: Itxaka <itxaka@spectrocloud.com>
This commit is contained in:
Itxaka
2023-02-08 10:09:21 +01:00
parent 8366045036
commit 9aee940e64

View File

@@ -115,7 +115,7 @@ func (s *State) MountOP(what, where, t string, options []string, timeout time.Du
log.Logger.Debug().Str("what", what).Str("where", where).Str("type", t).Str("options", litter.Sdump(options)).Msg("Mount point does not exist, creating") log.Logger.Debug().Str("what", what).Str("where", where).Str("type", t).Str("options", litter.Sdump(options)).Msg("Mount point does not exist, creating")
err = os.MkdirAll(where, os.ModeDir|os.ModePerm) err = os.MkdirAll(where, os.ModeDir|os.ModePerm)
if err != nil { if err != nil {
log.Logger.Debug().Str("what", what).Str("where", where).Str("type", t).Str("options", litter.Sdump(options)).Err(err).Msg("") log.Logger.Debug().Str("what", what).Str("where", where).Str("type", t).Str("options", litter.Sdump(options)).Err(err).Msg("Creating dir")
continue continue
} }
} }
@@ -135,7 +135,7 @@ func (s *State) MountOP(what, where, t string, options []string, timeout time.Du
err := op.run() err := op.run()
if err != nil { if err != nil {
log.Logger.Debug().Str("what", what).Str("where", where).Str("type", t).Str("options", litter.Sdump(options)).Err(err).Msg("") log.Logger.Debug().Str("what", what).Str("where", where).Str("type", t).Str("options", litter.Sdump(options)).Err(err).Msg("mounting")
continue continue
} }
@@ -144,11 +144,11 @@ func (s *State) MountOP(what, where, t string, options []string, timeout time.Du
return nil return nil
case <-c.Done(): case <-c.Done():
e := fmt.Errorf("context canceled") e := fmt.Errorf("context canceled")
log.Logger.Debug().Str("what", what).Str("where", where).Str("type", t).Str("options", litter.Sdump(options)).Err(e).Msg("") log.Logger.Debug().Str("what", what).Str("where", where).Str("type", t).Str("options", litter.Sdump(options)).Err(e).Msg("mount canceled")
return e return e
case <-cc: case <-cc:
e := fmt.Errorf("timeout exhausted") e := fmt.Errorf("timeout exhausted")
log.Logger.Debug().Str("what", what).Str("where", where).Str("type", t).Str("options", litter.Sdump(options)).Err(e).Msg("") log.Logger.Debug().Str("what", what).Str("where", where).Str("type", t).Str("options", litter.Sdump(options)).Err(e).Msg("Mount timeout")
return e return e
} }
} }
@@ -394,6 +394,7 @@ func (s *State) Register(g *herd.Graph) error {
var err error var err error
for id, mountpoint := range s.CustomMounts { for id, mountpoint := range s.CustomMounts {
s.Logger.Debug().Str("what", id).Str("where", s.path(mountpoint)).Msg("mounting custom mounts")
err = multierror.Append(err, s.MountOP( err = multierror.Append(err, s.MountOP(
id, id,