class KubeDeployTools::ImageRegistry::Driver::Base

Public Class Methods

new(registry:) click to toggle source
# File lib/kube_deploy_tools/image_registry/driver/base.rb, line 11
def initialize(registry:)
  @registry = registry
end

Public Instance Methods

authorize() click to toggle source
# File lib/kube_deploy_tools/image_registry/driver/base.rb, line 19
def authorize
  Logger.info "performing registry login for #{@registry.prefix}"
  Shellrunner.check_call(*authorize_command, print_cmd: false)
end
authorize_command() click to toggle source
# File lib/kube_deploy_tools/image_registry/driver/base.rb, line 24
def authorize_command
  raise "#{self.class}#authorize_command needs explicit implementation"
end
delete_image(image, dryrun) click to toggle source
# File lib/kube_deploy_tools/image_registry/driver/base.rb, line 44
def delete_image(image, dryrun)
  raise "#{self.class}#delete_image needs explicit implementation"
end
delete_images(images, dryrun) click to toggle source
# File lib/kube_deploy_tools/image_registry/driver/base.rb, line 37
def delete_images(images, dryrun)
  # Naive default implementation.
  images.each do |image|
    delete_image(image, dryrun)
  end
end
push_image(image) click to toggle source
# File lib/kube_deploy_tools/image_registry/driver/base.rb, line 15
def push_image(image)
  Shellrunner.check_call('docker', 'push', image.full_tag)
end
unauthorize() click to toggle source
# File lib/kube_deploy_tools/image_registry/driver/base.rb, line 28
def unauthorize
  Logger.info "Performing registry unauthorization for #{@registry.prefix}"
  Shellrunner.check_call(*unauthorize_command, print_cmd: false)
end
unauthorize_command() click to toggle source
# File lib/kube_deploy_tools/image_registry/driver/base.rb, line 33
def unauthorize_command
  raise "#{self.class}#unauthorize_command needs explicit implementation"
end