Vendor in latest containers/storage
Container/storage has been enhanced to speed up the compiling and loading of json files. This should make make cri-o a little bit faster. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
774d44589c
commit
70b1661e10
36 changed files with 11686 additions and 56 deletions
11
vendor/github.com/containers/storage/layers.go
generated
vendored
11
vendor/github.com/containers/storage/layers.go
generated
vendored
|
@ -254,6 +254,7 @@ func (r *layerStore) Load() error {
|
|||
compressedsums := make(map[digest.Digest][]string)
|
||||
uncompressedsums := make(map[digest.Digest][]string)
|
||||
if err = json.Unmarshal(data, &layers); len(data) == 0 || err == nil {
|
||||
idlist = make([]string, 0, len(layers))
|
||||
for n, layer := range layers {
|
||||
ids[layer.ID] = layers[n]
|
||||
idlist = append(idlist, layer.ID)
|
||||
|
@ -305,6 +306,9 @@ func (r *layerStore) Load() error {
|
|||
// actually delete.
|
||||
if r.IsReadWrite() {
|
||||
for _, layer := range r.layers {
|
||||
if layer.Flags == nil {
|
||||
layer.Flags = make(map[string]interface{})
|
||||
}
|
||||
if cleanup, ok := layer.Flags[incompleteFlag]; ok {
|
||||
if b, ok := cleanup.(bool); ok && b {
|
||||
err = r.Delete(layer.ID)
|
||||
|
@ -338,7 +342,7 @@ func (r *layerStore) Save() error {
|
|||
if err := os.MkdirAll(filepath.Dir(mpath), 0700); err != nil {
|
||||
return err
|
||||
}
|
||||
mounts := []layerMountPoint{}
|
||||
mounts := make([]layerMountPoint, 0, len(r.layers))
|
||||
for _, layer := range r.layers {
|
||||
if layer.MountPoint != "" && layer.MountCount > 0 {
|
||||
mounts = append(mounts, layerMountPoint{
|
||||
|
@ -455,6 +459,9 @@ func (r *layerStore) SetFlag(id string, flag string, value interface{}) error {
|
|||
if !ok {
|
||||
return ErrLayerUnknown
|
||||
}
|
||||
if layer.Flags == nil {
|
||||
layer.Flags = make(map[string]interface{})
|
||||
}
|
||||
layer.Flags[flag] = value
|
||||
return r.Save()
|
||||
}
|
||||
|
@ -733,7 +740,7 @@ func (r *layerStore) Wipe() error {
|
|||
if !r.IsReadWrite() {
|
||||
return errors.Wrapf(ErrStoreIsReadOnly, "not allowed to delete layers at %q", r.layerspath())
|
||||
}
|
||||
ids := []string{}
|
||||
ids := make([]string, 0, len(r.byid))
|
||||
for id := range r.byid {
|
||||
ids = append(ids, id)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue