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>2019-09-17 15:06:48 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-17 15:06:48 +0300
commitbd860c22f6a4b9473cbddd34a53eead8235a7ea1 (patch)
tree3f955a56c2ac90497863da26902a42dba49f3466 /app/services/clusters/applications
parente567b4c2df7dc4085d213db029eff6b6fcde0152 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/clusters/applications')
-rw-r--r--app/services/clusters/applications/base_service.rb4
-rw-r--r--app/services/clusters/applications/create_service.rb2
-rw-r--r--app/services/clusters/applications/destroy_service.rb2
-rw-r--r--app/services/clusters/applications/update_service.rb2
4 files changed, 7 insertions, 3 deletions
diff --git a/app/services/clusters/applications/base_service.rb b/app/services/clusters/applications/base_service.rb
index a9feb60be6e..67fb3ac8355 100644
--- a/app/services/clusters/applications/base_service.rb
+++ b/app/services/clusters/applications/base_service.rb
@@ -77,6 +77,10 @@ module Clusters
params[:application]
end
+ def application_class
+ Clusters::Cluster::APPLICATIONS[application_name]
+ end
+
def create_oauth_application(application, request)
oauth_application_params = {
name: params[:application],
diff --git a/app/services/clusters/applications/create_service.rb b/app/services/clusters/applications/create_service.rb
index f723c42c049..2a626a402e4 100644
--- a/app/services/clusters/applications/create_service.rb
+++ b/app/services/clusters/applications/create_service.rb
@@ -10,7 +10,7 @@ module Clusters
end
def builder
- cluster.public_send(:"application_#{application_name}") || # rubocop:disable GitlabSecurity/PublicSend
+ cluster.public_send(application_class.association_name) || # rubocop:disable GitlabSecurity/PublicSend
cluster.public_send(:"build_application_#{application_name}") # rubocop:disable GitlabSecurity/PublicSend
end
end
diff --git a/app/services/clusters/applications/destroy_service.rb b/app/services/clusters/applications/destroy_service.rb
index f3a4c4f754a..d666682487b 100644
--- a/app/services/clusters/applications/destroy_service.rb
+++ b/app/services/clusters/applications/destroy_service.rb
@@ -16,7 +16,7 @@ module Clusters
private
def builder
- cluster.public_send(:"application_#{application_name}") # rubocop:disable GitlabSecurity/PublicSend
+ cluster.public_send(application_class.association_name) # rubocop:disable GitlabSecurity/PublicSend
end
end
end
diff --git a/app/services/clusters/applications/update_service.rb b/app/services/clusters/applications/update_service.rb
index 0fa937da865..7a36401f156 100644
--- a/app/services/clusters/applications/update_service.rb
+++ b/app/services/clusters/applications/update_service.rb
@@ -10,7 +10,7 @@ module Clusters
end
def builder
- cluster.public_send(:"application_#{application_name}") # rubocop:disable GitlabSecurity/PublicSend
+ cluster.public_send(application_class.association_name) # rubocop:disable GitlabSecurity/PublicSend
end
end
end