mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-14 15:16:04 +10:00
28 lines
770 B
Ruby
28 lines
770 B
Ruby
class Projects::ContainerRegistryController < Projects::ApplicationController
|
|
before_action :authorize_read_container_registry!
|
|
before_action :authorize_update_container_registry!, only: [:destroy]
|
|
layout 'project'
|
|
|
|
def index
|
|
@tags = container_registry_repository.tags
|
|
end
|
|
|
|
def destroy
|
|
if tag.delete
|
|
redirect_to namespace_project_container_registry_index_path(project.namespace, project)
|
|
else
|
|
redirect_to namespace_project_container_registry_index_path(project.namespace, project), alert: 'Failed to remove tag'
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def container_registry_repository
|
|
@container_registry_repository ||= project.container_registry_repository
|
|
end
|
|
|
|
def tag
|
|
@tag ||= container_registry_repository[params[:id]]
|
|
end
|
|
end
|