summaryrefslogtreecommitdiff
path: root/app/controllers/clusters
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-08 12:06:32 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-08 12:06:32 +0000
commit61f0c58946ebac453b55a657cd4be1ac50a01e11 (patch)
tree7b164c1cc9dc8ab1d100ca4fe90decf6d72e984b /app/controllers/clusters
parentd23b2a0871f3ca507aafa949e0314625f1f0c6a7 (diff)
downloadgitlab-ce-61f0c58946ebac453b55a657cd4be1ac50a01e11.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/clusters')
-rw-r--r--app/controllers/clusters/clusters_controller.rb21
1 files changed, 14 insertions, 7 deletions
diff --git a/app/controllers/clusters/clusters_controller.rb b/app/controllers/clusters/clusters_controller.rb
index 7c5c4bb8e80..5dd4040628f 100644
--- a/app/controllers/clusters/clusters_controller.rb
+++ b/app/controllers/clusters/clusters_controller.rb
@@ -92,13 +92,12 @@ class Clusters::ClustersController < Clusters::BaseController
end
def destroy
- if cluster.destroy
- flash[:notice] = _('Kubernetes cluster integration was successfully removed.')
- redirect_to clusterable.index_path, status: :found
- else
- flash[:notice] = _('Kubernetes cluster integration was not removed.')
- render :show
- end
+ response = Clusters::DestroyService
+ .new(current_user, destroy_params)
+ .execute(cluster)
+
+ flash[:notice] = response[:message]
+ redirect_to clusterable.index_path, status: :found
end
def create_gcp
@@ -143,6 +142,14 @@ class Clusters::ClustersController < Clusters::BaseController
private
+ def destroy_params
+ # To be uncomented on https://gitlab.com/gitlab-org/gitlab/merge_requests/16954
+ # This MR got split into other since it was too big.
+ #
+ # params.permit(:cleanup)
+ {}
+ end
+
def update_params
if cluster.provided_by_user?
params.require(:cluster).permit(