Replace MakeStore() with GetStore(), which now keeps a list of all
running Store instances, so that we can't accidentally instantiate two
objects which attempt to manage the same store at the same time.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Switch MakeStore() to accepting an options structure instead of
individual arguments, so that adding options in the future won't require
rewriting logic that calls it, per discussion in issue #2.
This also lets the CLI wrapper pick up its defaults from the library, so
it no longer has to have them hard-coded.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Reset default locations to /var/{lib,run}/containers and not their
respective "storage" subdirectories. Make sure we build parent
directories every time we import layers, since another actor deleting
them may clean up something that we need to recreate.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Use a generic name, instead of something that might create branding or
trademark confusion, for default locations for filesystem paths.
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>
Add a notion of a runtime directory, to store non-persistent state
information, and use it to store mount locations at run-time.
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>