fix(deps): update module github.com/containers/common to v0.59.0

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2024-05-23 13:34:45 +00:00
committed by GitHub
parent 26f6b12a20
commit 25a4f08ee2
13 changed files with 57 additions and 1791 deletions

View File

@@ -16,6 +16,7 @@ import (
"github.com/containers/image/v5/pkg/docker/config"
"github.com/containers/image/v5/pkg/sysregistriesv2"
"github.com/containers/image/v5/types"
"github.com/containers/storage/pkg/fileutils"
"github.com/containers/storage/pkg/homedir"
"github.com/sirupsen/logrus"
)
@@ -69,7 +70,7 @@ func CheckAuthFile(pathOption string) error {
if pathOption == "" {
return nil
}
if _, err := os.Stat(pathOption); err != nil {
if err := fileutils.Exists(pathOption); err != nil {
return fmt.Errorf("credential file is not accessible: %w", err)
}
return nil

View File

@@ -8,12 +8,12 @@ package capabilities
import (
"errors"
"fmt"
"slices"
"sort"
"strings"
"sync"
"github.com/syndtr/gocapability/capability"
"golang.org/x/exp/slices"
)
var (

View File

@@ -5,7 +5,7 @@ os:
- linux
go:
- "1.13.x"
- "1.19.x"
matrix:
include:
@@ -17,7 +17,7 @@ addons:
- softhsm2
install:
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.30.0
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.53.2
script:
- make

View File

@@ -19,7 +19,6 @@ package pkcs11uri
import (
"errors"
"fmt"
"io/ioutil"
"net/url"
"os"
"path/filepath"
@@ -128,6 +127,12 @@ func (uri *Pkcs11URI) SetPathAttribute(name, value string) error {
return uri.setAttribute(uri.pathAttributes, name, value)
}
// SetPathAttributeUnencoded sets the value for a path attribute given as byte[].
// The value must not have been pct-encoded already.
func (uri *Pkcs11URI) SetPathAttributeUnencoded(name string, value []byte) {
uri.pathAttributes[name] = string(value)
}
// AddPathAttribute adds a path attribute; it returns an error if an attribute with the same
// name already existed or if the given value cannot be pct-unescaped
func (uri *Pkcs11URI) AddPathAttribute(name, value string) error {
@@ -137,6 +142,16 @@ func (uri *Pkcs11URI) AddPathAttribute(name, value string) error {
return uri.SetPathAttribute(name, value)
}
// AddPathAttributeUnencoded adds a path attribute given as byte[] which must not already be pct-encoded;
// it returns an error if an attribute with the same name already existed
func (uri *Pkcs11URI) AddPathAttributeUnencoded(name string, value []byte) error {
if _, ok := uri.pathAttributes[name]; ok {
return errors.New("duplicate path attribute")
}
uri.SetPathAttributeUnencoded(name, value)
return nil
}
// RemovePathAttribute removes a path attribute
func (uri *Pkcs11URI) RemovePathAttribute(name string) {
delete(uri.pathAttributes, name)
@@ -173,6 +188,12 @@ func (uri *Pkcs11URI) SetQueryAttribute(name, value string) error {
return uri.setAttribute(uri.queryAttributes, name, value)
}
// SetQueryAttributeUnencoded sets the value for a quiery attribute given as byte[].
// The value must not have been pct-encoded already.
func (uri *Pkcs11URI) SetQueryAttributeUnencoded(name string, value []byte) {
uri.queryAttributes[name] = string(value)
}
// AddQueryAttribute adds a query attribute; it returns an error if an attribute with the same
// name already existed or if the given value cannot be pct-unescaped
func (uri *Pkcs11URI) AddQueryAttribute(name, value string) error {
@@ -182,6 +203,16 @@ func (uri *Pkcs11URI) AddQueryAttribute(name, value string) error {
return uri.SetQueryAttribute(name, value)
}
// AddQueryAttributeUnencoded adds a query attribute given as byte[] which must not already be pct-encoded;
// it returns an error if an attribute with the same name already existed
func (uri *Pkcs11URI) AddQueryAttributeUnencoded(name string, value []byte) error {
if _, ok := uri.queryAttributes[name]; ok {
return errors.New("duplicate query attribute")
}
uri.SetQueryAttributeUnencoded(name, value)
return nil
}
// RemoveQueryAttribute removes a path attribute
func (uri *Pkcs11URI) RemoveQueryAttribute(name string) {
delete(uri.queryAttributes, name)
@@ -257,7 +288,7 @@ func (uri *Pkcs11URI) GetPIN() (string, error) {
if !filepath.IsAbs(pinuri.Path) {
return "", fmt.Errorf("PIN URI path '%s' is not absolute", pinuri.Path)
}
pin, err := ioutil.ReadFile(pinuri.Path)
pin, err := os.ReadFile(pinuri.Path)
if err != nil {
return "", fmt.Errorf("Could not open PIN file: %s", err)
}
@@ -426,7 +457,7 @@ func (uri *Pkcs11URI) GetModule() (string, error) {
moduleName = strings.ToLower(moduleName)
for _, dir := range searchdirs {
files, err := ioutil.ReadDir(dir)
files, err := os.ReadDir(dir)
if err != nil {
continue
}