2017-08-17 22:00:37 +05:30
|
|
|
module Projects
|
|
|
|
module Registry
|
|
|
|
class TagsController < ::Projects::Registry::ApplicationController
|
|
|
|
before_action :authorize_update_container_image!, only: [:destroy]
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
if tag.delete
|
2017-09-10 17:25:29 +05:30
|
|
|
redirect_to project_container_registry_index_path(@project),
|
|
|
|
status: 302,
|
2017-08-17 22:00:37 +05:30
|
|
|
notice: 'Registry tag has been removed successfully!'
|
|
|
|
else
|
2017-09-10 17:25:29 +05:30
|
|
|
redirect_to project_container_registry_index_path(@project),
|
|
|
|
status: 302,
|
2017-08-17 22:00:37 +05:30
|
|
|
alert: 'Failed to remove registry tag!'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def image
|
|
|
|
@image ||= project.container_repositories
|
|
|
|
.find(params[:repository_id])
|
|
|
|
end
|
|
|
|
|
|
|
|
def tag
|
|
|
|
@tag ||= image.tag(params[:id])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|