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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2018-10-14 23:42:29 +0300
committerThong Kuah <tkuah@gitlab.com>2018-10-29 06:21:31 +0300
commit0e15eec86d83cbdfefe17966bf5c02e4d419a34d (patch)
treef2928be797556746f44e2689181d3cd5ba4dab79 /app/models/concerns/deployment_platform.rb
parentb868b02c626dc4f9986eb93e54cf593055121972 (diff)
Associate clusters model to groups
Even though we currently only should have one group for a cluster, we allow the flexibility to associate to other groups in the future. This also matches the runner <=> groups association. - Adds Cluster#first_group, aliased to Cluster#group. For the conceivable future, a cluster will have at most one group. - Prevent mixing of group and project clusters. If project type clusters, it should only have projects assigned. Similarly with groups. - Default cluster_type to :project_type. As it's very small table we can set default and null: false in one release.
Diffstat (limited to 'app/models/concerns/deployment_platform.rb')
-rw-r--r--app/models/concerns/deployment_platform.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/concerns/deployment_platform.rb b/app/models/concerns/deployment_platform.rb
index 91052013592..e57a3383544 100644
--- a/app/models/concerns/deployment_platform.rb
+++ b/app/models/concerns/deployment_platform.rb
@@ -42,6 +42,7 @@ module DeploymentPlatform
{
name: 'kubernetes-template',
projects: [self],
+ cluster_type: :project_type,
provider_type: :user,
platform_type: :kubernetes,
platform_kubernetes_attributes: platform_kubernetes_attributes_from_service_template