Class: Dependabot::Docker::UpdateChecker

Inherits:
UpdateCheckers::Base
  • Object
show all
Defined in:
lib/dependabot/docker/update_checker.rb

Instance Method Summary collapse

Instance Method Details

#latest_resolvable_versionObject



22
23
24
25
# File 'lib/dependabot/docker/update_checker.rb', line 22

def latest_resolvable_version
  # Resolvability isn't an issue for Docker containers.
  latest_version
end

#latest_resolvable_version_with_no_unlockObject



27
28
29
30
# File 'lib/dependabot/docker/update_checker.rb', line 27

def latest_resolvable_version_with_no_unlock
  # No concept of "unlocking" for Docker containers
  dependency.version
end

#latest_versionObject



18
19
20
# File 'lib/dependabot/docker/update_checker.rb', line 18

def latest_version
  latest_version_from(dependency.version)
end

#updated_requirementsObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/dependabot/docker/update_checker.rb', line 32

def updated_requirements
  dependency.requirements.map do |req|
    updated_source = req.fetch(:source).dup

    tag = req[:source][:tag]
    digest = req[:source][:digest]

    if tag
      updated_tag = latest_version_from(tag)
      updated_source[:tag] = updated_tag
      updated_source[:digest] = digest_of(updated_tag) if digest
    elsif digest
      updated_source[:digest] = digest_of("latest")
    end

    req.merge(source: updated_source)
  end
end