Welcome to mirror list, hosted at ThFree Co, Russian Federation.

build_service.rb « clusters « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b1ac5549e30b1ee458b5f0b2c152804461cf38f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true
module Clusters
  class BuildService
    def initialize(subject)
      @subject = subject
    end

    def execute
      ::Clusters::Cluster.new.tap do |cluster|
        case @subject
        when ::Project
          cluster.cluster_type = :project_type
        when ::Group
          cluster.cluster_type = :group_type
        when Instance
          cluster.cluster_type = :instance_type
        else
          raise NotImplementedError
        end
      end
    end
  end
end