vendor: update c/common

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2025-03-20 13:14:42 +01:00
parent 2b0aef554e
commit 88b62d2c27
219 changed files with 15969 additions and 3857 deletions

View File

@@ -5,14 +5,14 @@ import (
"errors"
"fmt"
"io"
"maps"
"os"
"path/filepath"
"sort"
"slices"
"github.com/containers/common/pkg/secrets/define"
"github.com/containers/storage/pkg/fileutils"
"github.com/containers/storage/pkg/lockfile"
"golang.org/x/exp/maps"
)
// secretsDataFile is the file where secrets data/payload will be stored
@@ -53,9 +53,7 @@ func (d *Driver) List() ([]string, error) {
if err != nil {
return nil, err
}
allID := maps.Keys(secretData)
sort.Strings(allID)
return allID, err
return slices.Sorted(maps.Keys(secretData)), nil
}
// Lookup returns the bytes associated with a secret ID

View File

@@ -3,8 +3,10 @@ package secrets
import (
"errors"
"fmt"
"maps"
"os"
"path/filepath"
"slices"
"strings"
"time"
@@ -14,7 +16,6 @@ import (
"github.com/containers/common/pkg/secrets/shelldriver"
"github.com/containers/storage/pkg/lockfile"
"github.com/containers/storage/pkg/stringid"
"golang.org/x/exp/maps"
)
// maxSecretSize is the max size for secret data - 512kB
@@ -290,7 +291,7 @@ func (s *SecretsManager) List() ([]Secret, error) {
if err != nil {
return nil, err
}
return maps.Values(secrets), nil
return slices.Collect(maps.Values(secrets)), nil
}
// LookupSecretData returns secret metadata as well as secret data in bytes.