mirror of
https://github.com/containers/podman.git
synced 2025-09-28 01:04:28 +08:00
vendor c/common@main
Update the `--filter reference=...` tests to reflect recent changes in c/common. The reference values now match as specified without implicitly adding wildcards arounds. Fixes: #11905 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
20
vendor/github.com/containers/common/libimage/image.go
generated
vendored
20
vendor/github.com/containers/common/libimage/image.go
generated
vendored
@ -44,6 +44,8 @@ type Image struct {
|
||||
completeInspectData *ImageData
|
||||
// Corresponding OCI image.
|
||||
ociv1Image *ociv1.Image
|
||||
// Names() parsed into references.
|
||||
namesReferences []reference.Reference
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,6 +61,7 @@ func (i *Image) reload() error {
|
||||
i.cached.partialInspectData = nil
|
||||
i.cached.completeInspectData = nil
|
||||
i.cached.ociv1Image = nil
|
||||
i.cached.namesReferences = nil
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -89,6 +92,23 @@ func (i *Image) Names() []string {
|
||||
return i.storageImage.Names
|
||||
}
|
||||
|
||||
// NamesReferences returns Names() as references.
|
||||
func (i *Image) NamesReferences() ([]reference.Reference, error) {
|
||||
if i.cached.namesReferences != nil {
|
||||
return i.cached.namesReferences, nil
|
||||
}
|
||||
refs := make([]reference.Reference, 0, len(i.Names()))
|
||||
for _, name := range i.Names() {
|
||||
ref, err := reference.Parse(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
refs = append(refs, ref)
|
||||
}
|
||||
i.cached.namesReferences = refs
|
||||
return refs, nil
|
||||
}
|
||||
|
||||
// StorageImage returns the underlying storage.Image.
|
||||
func (i *Image) StorageImage() *storage.Image {
|
||||
return i.storageImage
|
||||
|
Reference in New Issue
Block a user