Skip to content

Conversation

@dhiltgen
Copy link
Contributor

If the system has a containerd-proxy managing the lifecycle
of the daemon, make sure the config is updated with the new image
on update.

Example manual test scenario:

root@daniel-testkit-B217D2-ubuntu-0:~# cat /etc/containerd-proxy/dockerd.json 
{
    "image": "docker.io/docker/engine-community",
    "imagePath": "/var/lib/docker-engine/engine.tar",
    "namespace":"docker",
    "args": [
        "--containerd", "/run/containerd/containerd.sock",
        "--default-runtime", "containerd",
        "--add-runtime", "containerd=runc"
    ],
    "scope": "ce"
}
root@daniel-testkit-B217D2-ubuntu-0:~# docker version --format '{{.Server.Version}}'
18.09.0-ce-tp4
root@daniel-testkit-B217D2-ubuntu-0:~# ./docker engine update --version 0.0.0-20180828050111-3bb99a8
0.0.0-201808: resolved 
waiting for engine to be responsive... engine is online.
Success!  The docker engine is now running.
root@daniel-testkit-B217D2-ubuntu-0:~# cat /etc/containerd-proxy/dockerd.json
{"namespace":"docker","image":"docker.io/docker/engine-community:0.0.0-20180828050111-3bb99a8","imagePath":"","args":["--containerd","/run/containerd/containerd.sock","--default-runtime","containerd","--add-runtime","containerd=runc"],"scope":"ce"}
root@daniel-testkit-B217D2-ubuntu-0:~# docker version --format '{{.Server.Version}}'
0.0.0-20180828050111-3bb99a8

If the system has a containerd-proxy managing the lifecycle
of the daemon, make sure the config is updated with the new image
on update.

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
@crosbymichael
Copy link
Contributor

LGTM

@andrewhsu
Copy link
Contributor

@dhiltgen needs port to master branch?

@dhiltgen
Copy link
Contributor Author

@dhiltgen needs port to master branch?

Yes, I'll get a cherry-pick going shortly.

return err
}
enc := json.NewEncoder(fd)
return enc.Encode(cfg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we need to check "enc != nil" before we call enc.Encode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can never be nil

@selansen
Copy link
Contributor

LGTM

@thaJeztah thaJeztah added this to the 18.09.0 milestone Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants