Skip to content

Commit

Permalink
snapshot/devmapper: log exported methods correctly
Browse files Browse the repository at this point in the history
- View was somehow logging itself as "prepare"
- Cleanup should have its debug log as like other exported methods

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
(cherry picked from commit 03ee450)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
kzys authored and thaJeztah committed Jul 20, 2021
1 parent a368d28 commit 5579467
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion snapshots/devmapper/snapshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func (s *Snapshotter) Prepare(ctx context.Context, key, parent string, opts ...s

// View creates readonly thin device for the given snapshot key
func (s *Snapshotter) View(ctx context.Context, key, parent string, opts ...snapshots.Opt) ([]mount.Mount, error) {
log.G(ctx).WithFields(logrus.Fields{"key": key, "parent": parent}).Debug("prepare")
log.G(ctx).WithFields(logrus.Fields{"key": key, "parent": parent}).Debug("view")

var (
mounts []mount.Mount
Expand Down Expand Up @@ -511,6 +511,8 @@ func (s *Snapshotter) withTransaction(ctx context.Context, writable bool, fn fun
}

func (s *Snapshotter) Cleanup(ctx context.Context) error {
log.G(ctx).Debug("cleanup")

var removedDevices []*DeviceInfo

if !s.config.AsyncRemove {
Expand Down

0 comments on commit 5579467

Please sign in to comment.