summaryrefslogtreecommitdiff
path: root/app/controllers/projects/registry/tags_controller.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-04-06 15:00:26 -0500
committerDouwe Maan <douwe@selenight.nl>2017-04-06 15:00:26 -0500
commit792f6ed16fbbbfcb7badc00ab3bffa7498bb6407 (patch)
tree40250aa0b51e7e3ca560a8106f8c084ffa130674 /app/controllers/projects/registry/tags_controller.rb
parent1065ba4097bd50720ef8777d05c36f2e79048d46 (diff)
parent00e00cacf8cb4ce3bfb733bae47e7e594e91e294 (diff)
downloadgitlab-ce-792f6ed16fbbbfcb7badc00ab3bffa7498bb6407.tar.gz
Merge branch 'master' into new-resolvable-discussion
# Conflicts: # app/assets/javascripts/filtered_search/dropdown_hint.js # app/views/shared/issuable/_search_bar.html.haml
Diffstat (limited to 'app/controllers/projects/registry/tags_controller.rb')
-rw-r--r--app/controllers/projects/registry/tags_controller.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/app/controllers/projects/registry/tags_controller.rb b/app/controllers/projects/registry/tags_controller.rb
new file mode 100644
index 00000000000..d689cade3ab
--- /dev/null
+++ b/app/controllers/projects/registry/tags_controller.rb
@@ -0,0 +1,28 @@
+module Projects
+ module Registry
+ class TagsController < ::Projects::Registry::ApplicationController
+ before_action :authorize_update_container_image!, only: [:destroy]
+
+ def destroy
+ if tag.delete
+ redirect_to project_container_registry_path(@project),
+ notice: 'Registry tag has been removed successfully!'
+ else
+ redirect_to project_container_registry_path(@project),
+ 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