Skip to content

Commit ccc38fd

Browse files
authored
Merge pull request AliyunContainerService#1307 from allencloud/modify-lock
feature: update lock policy for container management
2 parents f742cf2 + 36f4092 commit ccc38fd

File tree

11 files changed

+401
-274
lines changed

11 files changed

+401
-274
lines changed

apis/server/image_bridge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (s *Server) removeImage(ctx context.Context, rw http.ResponseWriter, req *h
107107

108108
isForce := httputils.BoolValue(req, "force")
109109
if !isForce && len(containers) > 0 {
110-
return fmt.Errorf("Unable to remove the image %q (must force) - container %s is using this image", image.ID, containers[0].ID)
110+
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)
111111
}
112112

113113
if err := s.ImageMgr.RemoveImage(ctx, name, isForce); err != nil {

ctrd/container.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ func (c *Client) createTask(ctx context.Context, id string, container containerd
411411
// create task
412412
task, err := container.NewTask(ctx, io)
413413
if err != nil {
414-
return pack, errors.Wrapf(err, "failed to create task, container id: %s", id)
414+
return pack, errors.Wrapf(err, "failed to create task for container(%s)", id)
415415
}
416416

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

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

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

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

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

437437
pack = &containerPack{
438438
id: id,

daemon/containerio/jsonfile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func init() {
2222

2323
var jsonFilePathName = "json.log"
2424

25-
// TODO(fuwei): add compress/logrotate configure
25+
// TODO(fuwei): add compress/logrotate configuration
2626
type jsonFile struct {
2727
closed bool
2828

0 commit comments

Comments
 (0)