mirror of
https://github.com/containers/podman.git
synced 2025-12-01 02:27:13 +08:00
Fix broken podman images filters
The id, digest, and intermediate filters were broken for podman images. Fix to match on substrings instead of the whole string for id and digest. Add the intermediate value correctly when set. Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
This commit is contained in:
11
vendor/github.com/containers/common/libimage/image.go
generated
vendored
11
vendor/github.com/containers/common/libimage/image.go
generated
vendored
@@ -169,6 +169,17 @@ func (i *Image) hasDigest(wantedDigest digest.Digest) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// containsDigestPrefix returns whether the specified value matches any digest of the
|
||||
// image. It checks for the prefix and not a full match.
|
||||
func (i *Image) containsDigestPrefix(wantedDigestPrefix string) bool {
|
||||
for _, d := range i.Digests() {
|
||||
if strings.HasPrefix(d.String(), wantedDigestPrefix) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsReadOnly returns whether the image is set read only.
|
||||
func (i *Image) IsReadOnly() bool {
|
||||
return i.storageImage.ReadOnly
|
||||
|
||||
Reference in New Issue
Block a user