Implement ListLayers() for the aufs, btrfs, and devicemapper drivers,
along with a unit test for them.
Stop filtering out directories with names that aren't 64-hex chars in
vfs and overlay ListLayers() implementations, which is more a convention
than a hard rule.
Have layerStore.Wipe() try to remove remaining listed layers after it
removes the layers that the layerStore knew of.
Close() a dangling ReadCloser in NaiveCreateFromTemplate.
Switch from using plain defer to using t.Cleanup() to handle deleting
layers that tests create, have the addManyLayers() test function do so
as well.
Remove vfs.CopyDir, which near as I can tell isn't referenced anywhere.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Add "unshare", "create-storage-layer", and "storage-layers" commands to
the test helper, along with a "-U" flag to have it unshare when handling
a given command.
Add "-o" as an alias for the "--owner" flag to "copy".
Add "-r" as an alias for the "--ro" flag to "mount".
Add a "-q" flag to "layers" so that we can list just the IDs.
Drop mention of a couple of not-implemented options from
docs/containers-storage-create-layer.md.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
We previously started "pulling up" images when we changed their names,
and started denying the presence of images in read-only stores which
shared their ID with an image in the read-write store, so that it would
be possible to "remove" names from an image in read-only storage. We
forgot about the Flags field, so start pulling that up, too.
Do all of the above when we're asked to create an image, since denying
the presence of images with the same ID in read-only stores would
prevent us from finding the image by any of the names that it "had" just
a moment before we created the new record.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Add ExplicitCommit option to provide calling code the ability to
preserve original files when an application error occurs, not just
an error that occurs during writing.
Change Close() impl to safely handle redundant calls (for defer
usage safety)
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
Fix for post-testing error:
`cannot destroy 'tmp.uwIwWzoNp4/tmp': dataset is busy`
Thanks to @nalind for the fix.
Signed-off-by: Chris Evich <cevich@redhat.com>
Replace the newer nameLooksLikeID() function with calls to
stringid.Validate(), which does the same thing.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Convention for tests is that they Put() any layers they Get(). Fix this
omission in DriverTestSetQuota() and change the layer name from
"zfsTest" to "quotaTest", because we have quota support on more than
just zfs.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
When updateNames() copies an image's record from a read-only store into
the read-write store, copy the accompanying data as well.
Add fields for setting data items at creation-time to LayerOptions,
ImageOptions, and ContainerOptions to make this easier for us and our
consumers.
Replace the store-specific Create() (and the one CreateWithFlags() and
Put()) with private create() and put() methods, since they're not
intended for consumption outside of this package, and add Flags to the
options structures we pass into those methods. In create() methods,
make copies of those passed-in options structures before modifying any
of their contents.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
In newer kernel versions, the kernel overlay driver will attempt to
atomically create whiteout when items are removed from merged
directories.
We need to be able to detect when the underlying filesystem isn't able
to do that at startup-time (in this case, zfs before its 2.2 release),
so that we don't end up thinking we're fine, but mounting writeable
layers which reject attempts to delete things.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Fixed building of the containers/storage for linux without usage of CGO (tags="linux exclude_disk_quota" & CGO_ENABLED=0): added missing method for the stub Controller implementation.
Refs 891593970a.
Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>