Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-25 21:09:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-25 21:09:02 +0300
commit951616a26a61e880860ad862c1d45a8e3762b4bc (patch)
treeed6fe722e955aff38e13ca02d2aa7fdd4239c863 /app/controllers/admin
parente06d0e779673d745972863302858105aad9032e5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/admin')
-rw-r--r--app/controllers/admin/serverless/domains_controller.rb16
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