Add a truncindex to the layer, image, and container stores, so that
layers, images, and containers can also be referred to by truncated
versions of their IDs in any place where we previously accepted names.
For containers, we don't add a truncated index for referring to
containers by layer ID, because there doesn't appear to be a minimum
length in truncindex, and we don't want to mistakenly treat a truncated
but not sufficiently-unique container ID as a layer ID, which would
likely resolve to some other different container.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Add GetContainerDirectory and GetContainerRunDirectory methods to the
store, for getting the location of a directory in which the caller can
manage data directly.
This breaks the general model of keeping the library's caller from
having to bother with where things are stored once the library is
initialized, but is added so that ocid won't have to manage the
directory in which it's dropping files to be picked up by other
binaries, in particular configuration files that it's leaving for runc.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Rename the Mall interface to Store, and the Store interface to
FileBasedStore. This is why you don't want me naming things, people.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Add a BigDataStore interface to the container store, too, so that
callers can use it to store items like container configurations, which
can get pretty complex.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Capitalize the first word of the help text that we've added for the -j
and -n options, to match the other help text.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Support attaching multiple names (instead of the previous optional one)
to layers, images, and containers. Add SetNames() and GetNames()
methods that accept an ID for any type of item. The CLI wrappers can
now be passed multiple -n/--name options.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Add a --json flag to most of the CLI commands, to force output that
would have gone to stdout to be output as JSON instead of whatever form
it would otherwise take. Error messages sent to stderr are still plain
text.
Use this chance to rework the wrapping logic so that it's more
consistent: commands that take multiple IDs attempt the specified
operation on all of them, and report errors afterward.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Rename the library module and CLI wrapper.
Rename daemon/graphdriver to drivers.
Catch up vendoring to match modules we've pruned.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>