summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-12-15 22:41:30 +0900
committerShinya Maeda <shinya@gitlab.com>2018-01-08 16:22:17 +0900
commit4dc14576d506218c71debb3a0600acdf855afe09 (patch)
treef5706ef8082b83903e278e85c90101fcc0e62e4d
parent27111e2940115be9c7c97648a95b80d9fefbf722 (diff)
downloadgitlab-ce-4dc14576d506218c71debb3a0600acdf855afe09.tar.gz
Fix comments
-rw-r--r--db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb b/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb
index 7c7e5046ec8..e05d206eb9c 100644
--- a/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb
+++ b/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb
@@ -52,24 +52,24 @@ class MigrateKubernetesServiceToNewClustersArchitectures < ActiveRecord::Migrati
belongs_to :project, class_name: 'Project'
# 10.1 ~ 10.2
- # When users create a cluster, KubernetesService is automatically synchronized
- # with Platforms::Kubernetes due to delegate Kubernetes specific logic.
- # We only target unmanaged KubernetesService records.
+ # When users created a cluster, KubernetesService was automatically configured
+ # by Platforms::Kubernetes parameters.
+ # Because Platforms::Kubernetes delegated some logic to KubernetesService.
#
# 10.3
- # We no longer create KubernetesService because Platforms::Kubernetes has the specific logic.
+ # When users create a cluster, KubernetesService is no longer synchronized.
+ # Because we copied delegated logic in Platforms::Kubernetes.
#
- # "unmanaged" means "unmanaged by Platforms::Kubernetes(New archetecture)"
- #
- # "cluster_projects.project_id IS NULL" -> it's not copied from KubernetesService
- # "services.properties NOT LIKE CONCAT('%', cluster_platforms_kubernetes.api_url, '%')" -> KubernetesService has unique configuration which is not included in Platforms::Kubernetes
+ # NOTE:
+ # - "unmanaged" means "unmanaged by Platforms::Kubernetes(New archetecture)"
+ # - We only want to migrate records which are not synchronized with Platforms::Kubernetes.
scope :unmanaged_kubernetes_service, -> do
- joins('INNER JOIN projects ON projects.id = services.project_id')
- .where("services.category = 'deployment'")
+ where("services.category = 'deployment'")
.where("services.type = 'KubernetesService'")
.where("services.template = FALSE")
.where("NOT EXISTS (?)",
PlatformsKubernetes
+ .joins('INNER JOIN projects ON projects.id = services.project_id')
.joins('INNER JOIN cluster_projects ON cluster_projects.project_id = projects.id')
.where('cluster_projects.cluster_id = cluster_platforms_kubernetes.cluster_id')
.where("services.properties LIKE CONCAT('%', cluster_platforms_kubernetes.api_url, '%')")