diff options
author | Thong Kuah <tkuah@gitlab.com> | 2019-04-13 00:19:28 +1200 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-04-29 22:55:12 -0700 |
commit | abb530a61958518f6e0c739406f34c558c504206 (patch) | |
tree | 14df66a315ff5dde728225d48b646a6596822d05 /app/controllers/clusters | |
parent | 43c284b711ddd4db55908de0590f946de5227db6 (diff) | |
download | gitlab-ce-abb530a61958518f6e0c739406f34c558c504206.tar.gz |
DELETE clusters/:id/:application endpoint
Add endpoint to delete/uninstall a cluster application
Diffstat (limited to 'app/controllers/clusters')
-rw-r--r-- | app/controllers/clusters/applications_controller.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/clusters/applications_controller.rb b/app/controllers/clusters/applications_controller.rb index 73c744efeba..16c2365f85d 100644 --- a/app/controllers/clusters/applications_controller.rb +++ b/app/controllers/clusters/applications_controller.rb @@ -4,6 +4,7 @@ class Clusters::ApplicationsController < Clusters::BaseController before_action :cluster before_action :authorize_create_cluster!, only: [:create] before_action :authorize_update_cluster!, only: [:update] + before_action :authorize_admin_cluster!, only: [:destroy] def create request_handler do @@ -21,6 +22,14 @@ class Clusters::ApplicationsController < Clusters::BaseController end end + def destroy + request_handler do + Clusters::Applications::DestroyService + .new(@cluster, current_user, cluster_application_destroy_params) + .execute(request) + end + end + private def request_handler @@ -40,4 +49,8 @@ class Clusters::ApplicationsController < Clusters::BaseController def cluster_application_params params.permit(:application, :hostname, :email) end + + def cluster_application_destroy_params + params.permit(:application) + end end |