summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-11-09 14:59:56 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-11-09 14:59:56 +0000
commit8b1212ed6d9869d93b33a85149eef19a69c6842f (patch)
treee81b428e006a3e06b66affd658e75f418581875d /app/services
parentaa958abae01a0744f398b7b4691515d636393af7 (diff)
parentb054694e497d58302f9cbfd134e84f5304b68e27 (diff)
downloadgitlab-ce-8b1212ed6d9869d93b33a85149eef19a69c6842f.tar.gz
Merge branch '34758-group-cluster-controller' into 'master'
User can create a group level cluster and install applications See merge request gitlab-org/gitlab-ce!22450
Diffstat (limited to 'app/services')
-rw-r--r--app/services/clusters/applications/create_service.rb11
-rw-r--r--app/services/clusters/create_service.rb4
2 files changed, 14 insertions, 1 deletions
diff --git a/app/services/clusters/applications/create_service.rb b/app/services/clusters/applications/create_service.rb
index c348cad4803..844807c2581 100644
--- a/app/services/clusters/applications/create_service.rb
+++ b/app/services/clusters/applications/create_service.rb
@@ -42,7 +42,16 @@ module Clusters
def builders
{
"helm" => -> (cluster) { cluster.application_helm || cluster.build_application_helm },
- "ingress" => -> (cluster) { cluster.application_ingress || cluster.build_application_ingress },
+ "ingress" => -> (cluster) { cluster.application_ingress || cluster.build_application_ingress }
+ }.tap do |hash|
+ hash.merge!(project_builders) if cluster.project_type?
+ end
+ end
+
+ # These applications will need extra configuration to enable them to work
+ # with groups of projects
+ def project_builders
+ {
"prometheus" => -> (cluster) { cluster.application_prometheus || cluster.build_application_prometheus },
"runner" => -> (cluster) { cluster.application_runner || cluster.build_application_runner },
"jupyter" => -> (cluster) { cluster.application_jupyter || cluster.build_application_jupyter },
diff --git a/app/services/clusters/create_service.rb b/app/services/clusters/create_service.rb
index 270db4a52fd..5a9da053780 100644
--- a/app/services/clusters/create_service.rb
+++ b/app/services/clusters/create_service.rb
@@ -36,6 +36,10 @@ module Clusters
case clusterable
when ::Project
{ cluster_type: :project_type, projects: [clusterable] }
+ when ::Group
+ { cluster_type: :group_type, groups: [clusterable] }
+ else
+ raise NotImplementedError
end
end