Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: update lock policy for container management #1307

Merged
merged 1 commit into from
Jun 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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