Commit 83d1fe9b authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add serveral minor improvements to container registry

parent 00319e59
......@@ -9,7 +9,8 @@ module Projects
def destroy
if image.destroy
redirect_to project_container_registry_path(@project)
redirect_to project_container_registry_path(@project),
notice: 'Images repository has been removed successfully!'
else
redirect_to project_container_registry_path(@project),
alert: 'Failed to remove images repository!'
......
......@@ -5,7 +5,8 @@ module Projects
def destroy
if tag.delete
redirect_to project_container_registry_path(@project)
redirect_to project_container_registry_path(@project),
notice: 'Tag removed successfull!'
else
redirect_to project_container_registry_path(@project),
alert: 'Failed to remove repository tag!'
......
......@@ -4,7 +4,8 @@ class ContainerRepository < ActiveRecord::Base
validates :name, length: { minimum: 0, allow_nil: false }
delegate :client, to: :registry
before_destroy :delete_tags
before_destroy :delete_tags!
def registry
@registry ||= begin
......
......@@ -10,7 +10,11 @@
= escape_once(image.path)
= clipboard_button(clipboard_text: "docker pull #{image.path}")
.controls.hidden-xs.pull-right
= link_to namespace_project_container_registry_path(@project.namespace, @project, image.id), class: 'btn btn-remove has-tooltip', title: "Remove image", data: { confirm: "Are you sure?" }, method: :delete do
= link_to namespace_project_container_registry_path(@project.namespace, @project, image),
class: 'btn btn-remove has-tooltip',
title: 'Remove repository',
data: { confirm: 'Are you sure?' },
method: :delete do
= icon("trash cred")
......
......@@ -36,9 +36,7 @@ module ContainerRegistry
end
def digest
return @digest if defined?(@digest)
@digest = client.repository_tag_digest(repository.path, name)
@digest ||= client.repository_tag_digest(repository.path, name)
end
def config_blob
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment