summaryrefslogtreecommitdiff
path: root/app/models/concerns
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2018-12-03 10:22:33 +1300
committerThong Kuah <tkuah@gitlab.com>2018-12-05 10:16:44 +1300
commitf85440e63c2eba453e09a5599f0d3e0491a037f1 (patch)
tree0548088994807a52b2a81c87964ffdee835687e1 /app/models/concerns
parentd54791e0942ae774876db22675cde1b54f35109d (diff)
downloadgitlab-ce-f85440e63c2eba453e09a5599f0d3e0491a037f1.tar.gz
Various improvements to hierarchy sorting
- Rename ordered_group_clusters_for_project -> ancestor_clusters_for_clusterable - Improve name of order option. It makes much more sense to have `hierarchy_order: :asc` and `hierarchy_order: :desc` - Allow ancestor_clusters_for_clusterable for group - Re-use code already present in Project
Diffstat (limited to 'app/models/concerns')
-rw-r--r--app/models/concerns/deployment_platform.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/concerns/deployment_platform.rb b/app/models/concerns/deployment_platform.rb
index d785e0d505f..ad981f4a8a3 100644
--- a/app/models/concerns/deployment_platform.rb
+++ b/app/models/concerns/deployment_platform.rb
@@ -32,8 +32,8 @@ module DeploymentPlatform
# EE would override this and utilize environment argument
def find_group_cluster_platform_kubernetes(environment: nil)
- Clusters::Cluster.enabled.default_environment.ordered_group_clusters_for_project(id)
- .last&.platform_kubernetes
+ Clusters::Cluster.enabled.default_environment.ancestor_clusters_for_clusterable(self)
+ .first&.platform_kubernetes
end
def find_kubernetes_service_integration