diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-17 12:06:48 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-17 12:06:48 +0000 |
commit | bd860c22f6a4b9473cbddd34a53eead8235a7ea1 (patch) | |
tree | 3f955a56c2ac90497863da26902a42dba49f3466 /app/services/clusters | |
parent | e567b4c2df7dc4085d213db029eff6b6fcde0152 (diff) | |
download | gitlab-ce-bd860c22f6a4b9473cbddd34a53eead8235a7ea1.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/clusters')
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 |