summaryrefslogtreecommitdiff
path: root/libpod/runtime_volume_linux.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-03-11 18:04:51 -0700
committerGitHub <noreply@github.com>2019-03-11 18:04:51 -0700
commit300b53cffea54724132028a2a7da5f6c77cd546c (patch)
tree71d3c99b3342c81a6d70a722879bd9a8a1f1d259 /libpod/runtime_volume_linux.go
parentdcd253f2e4da25e7e5af33bef4de5529162a7c1b (diff)
parentca1e76ff632dec0b0e00e25f26677887ca8cc625 (diff)
downloadpodman-300b53cffea54724132028a2a7da5f6c77cd546c.tar.gz
podman-300b53cffea54724132028a2a7da5f6c77cd546c.tar.bz2
podman-300b53cffea54724132028a2a7da5f6c77cd546c.zip
Merge pull request #2527 from baude/events
Add event logging to libpod, even display to podman
Diffstat (limited to 'libpod/runtime_volume_linux.go')
-rw-r--r--libpod/runtime_volume_linux.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/libpod/runtime_volume_linux.go b/libpod/runtime_volume_linux.go
index 838c0167a..b51bb8213 100644
--- a/libpod/runtime_volume_linux.go
+++ b/libpod/runtime_volume_linux.go
@@ -8,6 +8,7 @@ import (
"path/filepath"
"strings"
+ "github.com/containers/libpod/libpod/events"
"github.com/containers/storage/pkg/stringid"
"github.com/opencontainers/selinux/go-selinux/label"
"github.com/pkg/errors"
@@ -73,7 +74,7 @@ func (r *Runtime) newVolume(ctx context.Context, options ...VolumeCreateOption)
if err := r.state.AddVolume(volume); err != nil {
return nil, errors.Wrapf(err, "error adding volume to state")
}
-
+ defer volume.newVolumeEvent(events.Create)
return volume, nil
}
@@ -118,7 +119,7 @@ func (r *Runtime) removeVolume(ctx context.Context, v *Volume, force bool) error
return errors.Wrapf(err, "error cleaning up volume storage for %q", v.Name())
}
+ defer v.newVolumeEvent(events.Remove)
logrus.Debugf("Removed volume %s", v.Name())
-
return nil
}