summaryrefslogtreecommitdiff
path: root/app/services/clusters
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-11-01 12:57:05 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2017-11-01 13:57:32 +0100
commitccf09824f6d3ef41db4be3b40aa99b6dfd0dc9ac (patch)
treedd75a954bf30f49859c670834f13e0aac4f2d4ca /app/services/clusters
parent0c417ef0435ca49dba451a7270235f775d1d9a75 (diff)
downloadgitlab-ce-ccf09824f6d3ef41db4be3b40aa99b6dfd0dc9ac.tar.gz
Slim down Platforms::Kubernetes, and instead make it instrument KubernetesService
Diffstat (limited to 'app/services/clusters')
-rw-r--r--app/services/clusters/create_service.rb19
1 files changed, 3 insertions, 16 deletions
diff --git a/app/services/clusters/create_service.rb b/app/services/clusters/create_service.rb
index 503118fa6b6..a1c74566d7a 100644
--- a/app/services/clusters/create_service.rb
+++ b/app/services/clusters/create_service.rb
@@ -2,9 +2,6 @@ module Clusters
class CreateService < BaseService
attr_reader :access_token
- TEMPOLARY_API_URL = 'http://tempolary_api_url'.freeze
- TEMPOLARY_TOKEN = 'tempolary_token'.freeze
-
def execute(access_token)
@access_token = access_token
@@ -16,14 +13,9 @@ module Clusters
private
def create_cluster
- cluster = nil
-
- ActiveRecord::Base.transaction do
- cluster = Clusters::Cluster.create!(cluster_params)
- cluster.projects << project
- end
-
- cluster
+ Clusters::Cluster.create!(
+ cluster_params.merge(
+ projects: [project]))
rescue ActiveRecord::RecordInvalid => e
e.record
end
@@ -33,11 +25,6 @@ module Clusters
params[:provider_gcp_attributes].try do |provider|
provider[:access_token] = access_token
-
- params[:platform_kubernetes_attributes].try do |platform|
- platform[:api_url] = TEMPOLARY_API_URL
- platform[:token] = TEMPOLARY_TOKEN
- end
end
@cluster_params = params.merge(user: current_user)