diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 18:09:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 18:09:02 +0000 |
commit | 951616a26a61e880860ad862c1d45a8e3762b4bc (patch) | |
tree | ed6fe722e955aff38e13ca02d2aa7fdd4239c863 /app/controllers | |
parent | e06d0e779673d745972863302858105aad9032e5 (diff) | |
download | gitlab-ce-951616a26a61e880860ad862c1d45a8e3762b4bc.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin/serverless/domains_controller.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/controllers/admin/serverless/domains_controller.rb b/app/controllers/admin/serverless/domains_controller.rb index c37aec13105..9741a0716f2 100644 --- a/app/controllers/admin/serverless/domains_controller.rb +++ b/app/controllers/admin/serverless/domains_controller.rb @@ -2,7 +2,7 @@ class Admin::Serverless::DomainsController < Admin::ApplicationController before_action :check_feature_flag - before_action :domain, only: [:update, :verify] + before_action :domain, only: [:update, :verify, :destroy] def index @domain = PagesDomain.instance_serverless.first_or_initialize @@ -30,6 +30,20 @@ class Admin::Serverless::DomainsController < Admin::ApplicationController end end + def destroy + if domain.serverless_domain_clusters.count > 0 + return redirect_to admin_serverless_domains_path, + status: :conflict, + notice: _('Domain cannot be deleted while associated to one or more clusters.') + end + + domain.destroy! + + redirect_to admin_serverless_domains_path, + status: :found, + notice: _('Domain was successfully deleted.') + end + def verify result = VerifyPagesDomainService.new(domain).execute |