mirror of
https://github.com/containers/podman.git
synced 2025-12-05 21:32:22 +08:00
vendor: bump c/common to 9b0d134f392
Bump common to 9b0d134f392f41de3f3065aad162e73a3904168e Signed-off-by: flouthoc <flouthoc.git@gmail.com>
This commit is contained in:
7
vendor/github.com/containers/common/libimage/copier.go
generated
vendored
7
vendor/github.com/containers/common/libimage/copier.go
generated
vendored
@@ -178,7 +178,7 @@ type Copier struct {
|
||||
// Note that fields in options *may* overwrite the counterparts of
|
||||
// the specified system context. Please make sure to call `(*Copier).Close()`.
|
||||
func (r *Runtime) newCopier(options *CopyOptions) (*Copier, error) {
|
||||
return NewCopier(options, r.SystemContext(), nil)
|
||||
return NewCopier(options, r.SystemContext())
|
||||
}
|
||||
|
||||
// storageAllowedPolicyScopes overrides the policy for local storage
|
||||
@@ -225,7 +225,7 @@ func getDockerAuthConfig(name, passwd, creds, idToken string) (*types.DockerAuth
|
||||
// NewCopier creates a Copier based on a provided system context.
|
||||
// Note that fields in options *may* overwrite the counterparts of
|
||||
// the specified system context. Please make sure to call `(*Copier).Close()`.
|
||||
func NewCopier(options *CopyOptions, sc *types.SystemContext, reportResolvedReference *types.ImageReference) (*Copier, error) {
|
||||
func NewCopier(options *CopyOptions, sc *types.SystemContext) (*Copier, error) {
|
||||
c := Copier{extendTimeoutSocket: options.extendTimeoutSocket}
|
||||
sysContextCopy := *sc
|
||||
c.systemContext = &sysContextCopy
|
||||
@@ -332,7 +332,6 @@ func NewCopier(options *CopyOptions, sc *types.SystemContext, reportResolvedRefe
|
||||
c.imageCopyOptions.SignBySigstorePrivateKeyFile = options.SignBySigstorePrivateKeyFile
|
||||
c.imageCopyOptions.SignSigstorePrivateKeyPassphrase = options.SignSigstorePrivateKeyPassphrase
|
||||
c.imageCopyOptions.ReportWriter = options.Writer
|
||||
c.imageCopyOptions.ReportResolvedReference = reportResolvedReference
|
||||
|
||||
defaultContainerConfig, err := config.Default()
|
||||
if err != nil {
|
||||
@@ -489,7 +488,7 @@ func (c *Copier) copyToStorage(ctx context.Context, source, destination types.Im
|
||||
var resolvedReference types.ImageReference
|
||||
_, err := c.copyInternal(ctx, source, destination, &resolvedReference)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("internal error: unable to copy from source %s: %w", source, err)
|
||||
return nil, fmt.Errorf("internal error: unable to copy from source %s: %w", transports.ImageName(source), err)
|
||||
}
|
||||
if resolvedReference == nil {
|
||||
return nil, fmt.Errorf("internal error: After attempting to copy %s, resolvedReference is nil", source)
|
||||
|
||||
4
vendor/github.com/containers/common/libimage/image.go
generated
vendored
4
vendor/github.com/containers/common/libimage/image.go
generated
vendored
@@ -463,13 +463,13 @@ func (i *Image) removeRecursive(ctx context.Context, rmMap map[string]*RemoveIma
|
||||
skipRemove := false
|
||||
numNames := len(i.Names())
|
||||
|
||||
// NOTE: the `numNames == 1` check is not only a performance
|
||||
// NOTE: the `numNames != 1` check is not only a performance
|
||||
// optimization but also preserves existing Podman/Docker behaviour.
|
||||
// If image "foo" is used by a container and has only this tag/name,
|
||||
// an `rmi foo` will not untag "foo" but instead attempt to remove the
|
||||
// entire image. If there's a container using "foo", we should get an
|
||||
// error.
|
||||
if !(referencedBy == "" || numNames == 1) {
|
||||
if referencedBy != "" && numNames != 1 {
|
||||
byID := strings.HasPrefix(i.ID(), referencedBy)
|
||||
byDigest := strings.HasPrefix(referencedBy, "sha256:")
|
||||
if !options.Force {
|
||||
|
||||
2
vendor/github.com/containers/common/libimage/load.go
generated
vendored
2
vendor/github.com/containers/common/libimage/load.go
generated
vendored
@@ -115,7 +115,7 @@ func (r *Runtime) Load(ctx context.Context, path string, options *LoadOptions) (
|
||||
|
||||
// Give a decent error message if nothing above worked.
|
||||
// we want the colon here for the multiline error
|
||||
//nolint:revive
|
||||
//nolint:revive,staticcheck
|
||||
loadError := errors.New("payload does not match any of the supported image formats:")
|
||||
for _, err := range loadErrors {
|
||||
loadError = fmt.Errorf("%v\n * %v", loadError, err)
|
||||
|
||||
2
vendor/github.com/containers/common/libimage/normalize.go
generated
vendored
2
vendor/github.com/containers/common/libimage/normalize.go
generated
vendored
@@ -30,7 +30,7 @@ func NormalizeName(name string) (reference.Named, error) {
|
||||
|
||||
// Enforce "localhost" if needed.
|
||||
registry := reference.Domain(named)
|
||||
if !(strings.ContainsAny(registry, ".:") || registry == "localhost") {
|
||||
if !strings.ContainsAny(registry, ".:") && registry != "localhost" {
|
||||
name = toLocalImageName(ref.String())
|
||||
}
|
||||
|
||||
|
||||
2
vendor/github.com/containers/common/libimage/search.go
generated
vendored
2
vendor/github.com/containers/common/libimage/search.go
generated
vendored
@@ -217,7 +217,7 @@ func (r *Runtime) searchImageInRegistry(ctx context.Context, term, registry stri
|
||||
paramsArr := []SearchResult{}
|
||||
for i := range limit {
|
||||
// Check whether query matches filters
|
||||
if !(filterMatchesAutomatedFilter(&options.Filter, results[i]) && filterMatchesOfficialFilter(&options.Filter, results[i]) && filterMatchesStarFilter(&options.Filter, results[i])) {
|
||||
if !filterMatchesAutomatedFilter(&options.Filter, results[i]) || !filterMatchesOfficialFilter(&options.Filter, results[i]) || !filterMatchesStarFilter(&options.Filter, results[i]) {
|
||||
continue
|
||||
}
|
||||
official := ""
|
||||
|
||||
Reference in New Issue
Block a user