Vendor in latest c/common

Pull in updates made to the filters code for
images. Filters now perform an AND operation
except for th reference filter which does an
OR operation for positive case but an AND operation
for negative cases.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
This commit is contained in:
Urvashi Mohnani
2024-01-24 08:11:51 -05:00
parent d66b18f5af
commit 7c8c945496
197 changed files with 1521 additions and 1350 deletions

View File

@@ -10,6 +10,7 @@ import (
"sort"
"github.com/containers/storage/pkg/lockfile"
"golang.org/x/exp/maps"
)
// secretsDataFile is the file where secrets data/payload will be stored
@@ -56,10 +57,7 @@ func (d *Driver) List() ([]string, error) {
if err != nil {
return nil, err
}
allID := make([]string, 0, len(secretData))
for k := range secretData {
allID = append(allID, k)
}
allID := maps.Keys(secretData)
sort.Strings(allID)
return allID, err
}
@@ -79,7 +77,7 @@ func (d *Driver) Lookup(id string) ([]byte, error) {
return nil, fmt.Errorf("%s: %w", id, errNoSecretData)
}
// Store stores the bytes associated with an ID. An error is returned if the ID arleady exists
// Store stores the bytes associated with an ID. An error is returned if the ID already exists
func (d *Driver) Store(id string, data []byte) error {
d.lockfile.Lock()
defer d.lockfile.Unlock()

View File

@@ -13,6 +13,7 @@ import (
"github.com/containers/storage/pkg/lockfile"
"github.com/containers/storage/pkg/regexp"
"github.com/containers/storage/pkg/stringid"
"golang.org/x/exp/maps"
)
// maxSecretSize is the max size for secret data - 512kB
@@ -289,11 +290,7 @@ func (s *SecretsManager) List() ([]Secret, error) {
if err != nil {
return nil, err
}
ls := make([]Secret, 0, len(secrets))
for _, v := range secrets {
ls = append(ls, v)
}
return ls, nil
return maps.Values(secrets), nil
}
// LookupSecretData returns secret metadata as well as secret data in bytes.