software_spec: fix wrong tab being fetched when bottle isn't unique

This commit is contained in:
Bo Anderson 2021-05-31 16:06:27 +01:00
parent 5115cc25fa
commit 9380729dbf
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -386,8 +386,11 @@ class Bottle
raise ArgumentError, "Missing 'annotations' section." if manifests_annotations.blank?
bottle_digest = @resource.checksum.hexdigest
image_ref = GitHubPackages.version_rebuild(@resource.version, rebuild, @tag.to_s)
manifest_annotations = manifests_annotations.find do |m|
m["sh.brew.bottle.digest"] == bottle_digest
next if m["sh.brew.bottle.digest"] != bottle_digest
m["org.opencontainers.image.ref.name"] == image_ref
end
raise ArgumentError, "Couldn't find manifest matching bottle checksum." if manifest_annotations.blank?