Containers created with Swarm<0.3.0 or directly on the host without
going through Swarm don't have a Swarm ID. We are going to fake it by
using the Container ID.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
- Every container that gets created through Swarm gets a Swarm ID
assigned (as a label).
- All API operations (start, stop, ...) can be performed by using either
the container ID or the swarm ID.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
The cluster configuration is now embedded into the container. It's
guaranteed to be correct (as in, generated by BuildContainerConfig) at
all times.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
- Renamed Events() to RegisterEventHandler() in Engine.
- Added RegisterEventHandler() to the Cluster interface.
- Removed EventHandler requirement from swarm's Cluster constructor.
- Make API's events handler private.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Engine.Container uses an array of containers from Engine.Containers, which is
built under an internal RLock, so the external RLock is useless.
Also allocate enough memory for the array of containers (images).
Signed-off-by: Anton Tiurin <noxiouz@yandex.ru>