1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

8 commits

Author SHA1 Message Date
Aaron Lehmann
1128fc1add Store container names in memdb
Currently, names are maintained by a separate system called "registrar".
This means there is no way to atomically snapshot the state of
containers and the names associated with them.

We can add this atomicity and simplify the code by storing name
associations in the memdb. This removes the need for pkg/registrar, and
makes snapshots a lot less expensive because they no longer need to copy
all the names. This change also avoids some problematic behavior from
pkg/registrar where it returns slices which may be modified later on.

Note that while this change makes the *snapshotting* atomic, it doesn't
yet do anything to make sure containers are named at the same time that
they are added to the database. We can do that by adding a transactional
interface, either as a followup, or as part of this PR.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-07-13 12:35:00 -07:00
Fabio Kung
03aa24721c no need to save state to disk here
State will be saved on the following operation once the container is
properly registered on the daemon.

Signed-off-by: Fabio Kung <fabio.kung@gmail.com>
2017-06-23 07:52:32 -07:00
Jorge Marin
2bee1cfd5a Use quoted form of container name and container id
Use quoted form of container name and container id to improve copy-paste avoiding the extra `.` that slips into the clipboard

Signed-off-by: Jorge Marin <chipironcin@users.noreply.github.com>
2017-01-17 08:26:05 +00:00
Vincent Demeester
dba271a42a
Move names to package api
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-21 22:42:47 +01:00
Yong Tang
c90ec05175 Restrict checkpoint name to prevent directory traversal
This fix tries to address the issue raised in 28769 where
checkpoint name was not checked before passing to containerd.
As a result, it was possible to use a special checkpoint name
to get outside of the container's directory.

This fix add restriction `[a-zA-Z0-9][a-zA-Z0-9_.-]+` (`RestrictedNamePattern`).
This is the same as container name restriction.

This fix fixes 28769.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-23 13:23:07 -08:00
David Trott
c9d0a77657 Added the word "container" to clarify the error message.
Signed-off-by: David Trott <github@davidtrott.com>
2016-08-22 13:41:17 -07:00
Vincent Demeester
bfa0885c37
Moving some more methods away from daemon.go
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-27 11:32:26 +02:00
Vincent Demeester
fb48bf518b
Move some container related methods and structs to smaller files
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-24 21:31:15 +02:00