cmd/dist, images: allow image delete
This adds very simple deletion of images by name. We still need to consider the approach to handling image name, so this may change. For the time being, it allows one to delete an image entry in the metadata database. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
@@ -103,6 +103,12 @@ func List(tx *bolt.Tx) ([]Image, error) {
|
||||
return images, nil
|
||||
}
|
||||
|
||||
func Delete(tx *bolt.Tx, name string) error {
|
||||
return withImagesBucket(tx, func(bkt *bolt.Bucket) error {
|
||||
return bkt.DeleteBucket([]byte(name))
|
||||
})
|
||||
}
|
||||
|
||||
func readImage(image *Image, bkt *bolt.Bucket) error {
|
||||
return bkt.ForEach(func(k, v []byte) error {
|
||||
if v == nil {
|
||||
|
||||
Reference in New Issue
Block a user