Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Dec 7, 2022
1 parent cd0910d commit 27e9d97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions docker/lib/dependabot/docker/update_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ def version_tag_up_to_date?(version)

def digest_up_to_date?
dependency.requirements.all? do |req|
next true unless req.fetch(:source)[:digest]
next true unless (new_digest = latest_digest)
next true unless (digest = req.fetch(:source)[:digest])
next true unless (new_digest = updated_digest)

req.fetch(:source).fetch(:digest) == new_digest
digest == new_digest
end
end

Expand Down Expand Up @@ -232,7 +232,11 @@ def canonical_version?(tag)
end

def updated_digest
@updated_digest ||= digest_of(latest_version)
@updated_digest ||= if latest_version.match?(DIGEST)
latest_digest
else
digest_of(latest_version)
end
end

def tags_from_registry
Expand Down
2 changes: 1 addition & 1 deletion docker/spec/dependabot/docker/update_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
let(:source) { { digest: digest } }

let(:headers_response) do
fixture("docker", "registry_manifest_headers", "ubuntu_17.10.json")
fixture("docker", "registry_manifest_headers", "generic.json")
end

before do
Expand Down

0 comments on commit 27e9d97

Please sign in to comment.