diff --git a/daemon/import.go b/daemon/import.go index 21ab7293c300e9c93591b77d852046d9a51c27ff..a0a475de7b4b8ad38985a64a125978f7ddaa9101 100644 --- a/daemon/import.go +++ b/daemon/import.go @@ -38,6 +38,9 @@ import ( // Import an image from a tarball func (b *Backend) Import(req *pb.ImportRequest, stream pb.Control_ImportServer) error { + b.daemon.RLock() + defer b.daemon.RUnlock() + var ( srcRef types.ImageReference ctx = stream.Context() diff --git a/daemon/load.go b/daemon/load.go index 2d0c15439f8eac992843185690a56d750a318277..c0713741cf0ccfc9627487e30b180ce11e782e12 100644 --- a/daemon/load.go +++ b/daemon/load.go @@ -79,6 +79,9 @@ func (b *Backend) getLoadOptions(req *pb.LoadRequest) (LoadOptions, error) { // Load loads the image func (b *Backend) Load(req *pb.LoadRequest, stream pb.Control_LoadServer) error { + b.daemon.RLock() + defer b.daemon.RUnlock() + logrus.WithFields(logrus.Fields{ "LoadID": req.GetLoadID(), }).Info("LoadRequest received") diff --git a/daemon/pull.go b/daemon/pull.go index 90be2a914f71d8e896419160b738170ce57a5e80..dc8af036a3aa0e4ecc2bef2b5e9551885b32bc1f 100644 --- a/daemon/pull.go +++ b/daemon/pull.go @@ -40,6 +40,9 @@ type pullOptions struct { // Pull receives a pull request and pull the image from remote repository func (b *Backend) Pull(req *pb.PullRequest, stream pb.Control_PullServer) error { + b.daemon.RLock() + defer b.daemon.RUnlock() + logrus.WithFields(logrus.Fields{ "PullID": req.GetPullID(), "ImageName": req.GetImageName(),