mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Vendor in latest containers/storage
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
24
vendor/github.com/containers/common/libimage/pull.go
generated
vendored
24
vendor/github.com/containers/common/libimage/pull.go
generated
vendored
@ -497,16 +497,26 @@ func (r *Runtime) copySingleImageFromRegistry(ctx context.Context, imageName str
|
||||
|
||||
customPlatform := len(options.Architecture)+len(options.OS)+len(options.Variant) > 0
|
||||
if customPlatform && pullPolicy != config.PullPolicyAlways && pullPolicy != config.PullPolicyNever {
|
||||
// Unless the pull policy is always/never, we must
|
||||
// pessimistically assume that the local image has an invalid
|
||||
// architecture (see containers/podman/issues/10682). Hence,
|
||||
// whenever the user requests a custom platform, set the pull
|
||||
// policy to "newer" to make sure we're pulling down the
|
||||
// Unless the specified platform matches the local image, we
|
||||
// must pessimistically assume that the local image has an
|
||||
// invalid architecture (see containers/podman/issues/10682).
|
||||
// Hence, whenever the user requests a custom platform, set the
|
||||
// pull policy to "newer" to make sure we're pulling down the
|
||||
// correct image.
|
||||
//
|
||||
// NOTE that this is will even override --pull={false,never}.
|
||||
pullPolicy = config.PullPolicyNewer
|
||||
logrus.Debugf("Enforcing pull policy to %q to pull custom platform (arch: %q, os: %q, variant: %q) - local image may mistakenly specify wrong platform", pullPolicy, options.Architecture, options.OS, options.Variant)
|
||||
localImageMatches := false
|
||||
if localImage != nil {
|
||||
_, matches, err := localImage.matchesPlatform(ctx, options.OS, options.Architecture, options.Variant)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
localImageMatches = matches
|
||||
}
|
||||
if !localImageMatches {
|
||||
pullPolicy = config.PullPolicyNewer
|
||||
logrus.Debugf("Enforcing pull policy to %q to pull custom platform (arch: %q, os: %q, variant: %q) - local image may mistakenly specify wrong platform", pullPolicy, options.Architecture, options.OS, options.Variant)
|
||||
}
|
||||
}
|
||||
|
||||
if pullPolicy == config.PullPolicyNever {
|
||||
|
12
vendor/github.com/containers/common/libnetwork/resolvconf/resolvconf.go
generated
vendored
12
vendor/github.com/containers/common/libnetwork/resolvconf/resolvconf.go
generated
vendored
@ -5,9 +5,9 @@ package resolvconf
|
||||
import (
|
||||
"bytes"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/containers/storage/pkg/regexp"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@ -32,11 +32,11 @@ var (
|
||||
// ipLocalhost is a regex pattern for IPv4 or IPv6 loopback range.
|
||||
ipLocalhost = `((127\.([0-9]{1,3}\.){2}[0-9]{1,3})|(::1)$)`
|
||||
|
||||
localhostNSRegexp = regexp.MustCompile(`(?m)^nameserver\s+` + ipLocalhost + `\s*\n*`)
|
||||
nsIPv6Regexp = regexp.MustCompile(`(?m)^nameserver\s+` + ipv6Address + `\s*\n*`)
|
||||
nsRegexp = regexp.MustCompile(`^\s*nameserver\s*((` + ipv4Address + `)|(` + ipv6Address + `))\s*$`)
|
||||
searchRegexp = regexp.MustCompile(`^\s*search\s*(([^\s]+\s*)*)$`)
|
||||
optionsRegexp = regexp.MustCompile(`^\s*options\s*(([^\s]+\s*)*)$`)
|
||||
localhostNSRegexp = regexp.Delayed(`(?m)^nameserver\s+` + ipLocalhost + `\s*\n*`)
|
||||
nsIPv6Regexp = regexp.Delayed(`(?m)^nameserver\s+` + ipv6Address + `\s*\n*`)
|
||||
nsRegexp = regexp.Delayed(`^\s*nameserver\s*((` + ipv4Address + `)|(` + ipv6Address + `))\s*$`)
|
||||
searchRegexp = regexp.Delayed(`^\s*search\s*(([^\s]+\s*)*)$`)
|
||||
optionsRegexp = regexp.Delayed(`^\s*options\s*(([^\s]+\s*)*)$`)
|
||||
)
|
||||
|
||||
// filterResolvDNS cleans up the config in resolvConf. It has two main jobs:
|
||||
|
4
vendor/github.com/containers/common/pkg/report/template.go
generated
vendored
4
vendor/github.com/containers/common/pkg/report/template.go
generated
vendored
@ -4,11 +4,11 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"github.com/containers/common/pkg/report/camelcase"
|
||||
"github.com/containers/storage/pkg/regexp"
|
||||
)
|
||||
|
||||
// Template embeds template.Template to add functionality to methods
|
||||
@ -160,7 +160,7 @@ func (t *Template) IsTable() bool {
|
||||
return t.isTable
|
||||
}
|
||||
|
||||
var rangeRegex = regexp.MustCompile(`(?s){{\s*range\s*\.\s*}}.*{{\s*end\s*-?\s*}}`)
|
||||
var rangeRegex = regexp.Delayed(`(?s){{\s*range\s*\.\s*}}.*{{\s*end\s*-?\s*}}`)
|
||||
|
||||
// EnforceRange ensures that the format string contains a range
|
||||
func EnforceRange(format string) string {
|
||||
|
4
vendor/github.com/containers/common/pkg/report/validate.go
generated
vendored
4
vendor/github.com/containers/common/pkg/report/validate.go
generated
vendored
@ -1,12 +1,12 @@
|
||||
package report
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"github.com/containers/storage/pkg/regexp"
|
||||
)
|
||||
|
||||
// Check for json, {{json }} and {{ json. }} which are not valid go template,
|
||||
// {{json .}} is valid and thus not matched to let the template handle it like docker does.
|
||||
var jsonRegex = regexp.MustCompile(`^\s*(json|{{\s*json\.?\s*}})\s*$`)
|
||||
var jsonRegex = regexp.Delayed(`^\s*(json|{{\s*json\.?\s*}})\s*$`)
|
||||
|
||||
// JSONFormat test CLI --format string to be a JSON request
|
||||
//
|
||||
|
4
vendor/github.com/containers/common/pkg/secrets/secrets.go
generated
vendored
4
vendor/github.com/containers/common/pkg/secrets/secrets.go
generated
vendored
@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -13,6 +12,7 @@ import (
|
||||
"github.com/containers/common/pkg/secrets/passdriver"
|
||||
"github.com/containers/common/pkg/secrets/shelldriver"
|
||||
"github.com/containers/storage/pkg/lockfile"
|
||||
"github.com/containers/storage/pkg/regexp"
|
||||
"github.com/containers/storage/pkg/stringid"
|
||||
)
|
||||
|
||||
@ -51,7 +51,7 @@ var secretsFile = "secrets.json"
|
||||
|
||||
// secretNameRegexp matches valid secret names
|
||||
// Allowed: 64 [a-zA-Z0-9-_.] characters, and the start and end character must be [a-zA-Z0-9]
|
||||
var secretNameRegexp = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`)
|
||||
var secretNameRegexp = regexp.Delayed(`^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`)
|
||||
|
||||
// SecretsManager holds information on handling secrets
|
||||
//
|
||||
|
2
vendor/github.com/containers/storage/VERSION
generated
vendored
2
vendor/github.com/containers/storage/VERSION
generated
vendored
@ -1 +1 @@
|
||||
1.44.1-dev
|
||||
1.45.0
|
||||
|
Reference in New Issue
Block a user