Skip to content

Commit

Permalink
Merge pull request #1307 from allencloud/modify-lock
Browse files Browse the repository at this point in the history
feature: update lock policy for container management
  • Loading branch information
allencloud authored Jun 5, 2018
2 parents f742cf2 + 36f4092 commit ccc38fd
Show file tree
Hide file tree
Showing 11 changed files with 401 additions and 274 deletions.
2 changes: 1 addition & 1 deletion apis/server/image_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (s *Server) removeImage(ctx context.Context, rw http.ResponseWriter, req *h

isForce := httputils.BoolValue(req, "force")
if !isForce && len(containers) > 0 {
return fmt.Errorf("Unable to remove the image %q (must force) - container %s is using this image", image.ID, containers[0].ID)
return fmt.Errorf("Unable to remove the image %q (must force) - container (%s, %s) is using this image", image.ID, containers[0].ID, containers[0].Name)
}

if err := s.ImageMgr.RemoveImage(ctx, name, isForce); err != nil {
Expand Down
10 changes: 5 additions & 5 deletions ctrd/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ func (c *Client) createTask(ctx context.Context, id string, container containerd
// create task
task, err := container.NewTask(ctx, io)
if err != nil {
return pack, errors.Wrapf(err, "failed to create task, container id: %s", id)
return pack, errors.Wrapf(err, "failed to create task for container(%s)", id)
}

defer func() {
Expand All @@ -422,17 +422,17 @@ func (c *Client) createTask(ctx context.Context, id string, container containerd

statusCh, err := task.Wait(context.TODO())
if err != nil {
return pack, errors.Wrap(err, "failed to wait task")
return pack, errors.Wrapf(err, "failed to wait task in container", id)
}

logrus.Infof("success to new task, container id: %s, pid: %d", id, task.Pid())
logrus.Infof("success to create task(pid=%d) in container(%s)", task.Pid(), id)

// start task
if err := task.Start(ctx); err != nil {
return pack, errors.Wrapf(err, "failed to start task: %d, container id: %s", task.Pid(), id)
return pack, errors.Wrapf(err, "failed to start task(%d) in container(%s)", task.Pid(), id)
}

logrus.Infof("success to start task, container id: %s", id)
logrus.Infof("success to start task in container(%s)", id)

pack = &containerPack{
id: id,
Expand Down
2 changes: 1 addition & 1 deletion daemon/containerio/jsonfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func init() {

var jsonFilePathName = "json.log"

// TODO(fuwei): add compress/logrotate configure
// TODO(fuwei): add compress/logrotate configuration
type jsonFile struct {
closed bool

Expand Down
Loading

0 comments on commit ccc38fd

Please sign in to comment.