a1c216e5e4
These builder methods are using user provided input inside a public_send but this is safe to do in this instance because before they are called we check before calling them that they match an expected application name.
18 lines
550 B
Ruby
18 lines
550 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Clusters
|
|
module Applications
|
|
class CreateService < Clusters::Applications::BaseService
|
|
private
|
|
|
|
def worker_class(application)
|
|
application.updateable? ? ClusterUpgradeAppWorker : ClusterInstallAppWorker
|
|
end
|
|
|
|
def builder
|
|
cluster.public_send(:"application_#{application_name}") || # rubocop:disable GitlabSecurity/PublicSend
|
|
cluster.public_send(:"build_application_#{application_name}") # rubocop:disable GitlabSecurity/PublicSend
|
|
end
|
|
end
|
|
end
|
|
end
|