summaryrefslogtreecommitdiff
path: root/app/services/clusters/update_service.rb
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2018-10-11 12:15:04 +1300
committerThong Kuah <tkuah@gitlab.com>2018-10-15 11:01:09 +1300
commit19e1024bb874cdb9d912dd7de3cbc8f26daad048 (patch)
tree74f7891ef2134feee46837af5866ff75e5b2373b /app/services/clusters/update_service.rb
parentda4f77957ccff7cdf22110ef56a4286bbc5a7749 (diff)
downloadgitlab-ce-19e1024bb874cdb9d912dd7de3cbc8f26daad048.tar.gz
Pass in project as kwarg for CreateService
This enables us to have other options in the future such as passing in `group:`. Also, remove project arg from UpdateService, as un-used. This will help group cluster controller to re-use this services.
Diffstat (limited to 'app/services/clusters/update_service.rb')
-rw-r--r--app/services/clusters/update_service.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/services/clusters/update_service.rb b/app/services/clusters/update_service.rb
index 98fdeec4fb1..25d26e761b1 100644
--- a/app/services/clusters/update_service.rb
+++ b/app/services/clusters/update_service.rb
@@ -1,7 +1,13 @@
# frozen_string_literal: true
module Clusters
- class UpdateService < BaseService
+ class UpdateService
+ attr_reader :current_user, :params
+
+ def initialize(user = nil, params = {})
+ @current_user, @params = user, params.dup
+ end
+
def execute(cluster)
cluster.update(params)
end