diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2018-12-06 18:08:49 +0000 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-12-06 18:08:49 +0000 |
commit | 2c80a1c0de07877e6e2bf7ab20de2d4f43a0d97c (patch) | |
tree | afa7f5f54e2491e0c08168b6f4ce47511da3012b /app/models/clusters/cluster.rb | |
parent | e80f89337b4be31c5531448861cedb556d02c01e (diff) | |
download | gitlab-ce-2c80a1c0de07877e6e2bf7ab20de2d4f43a0d97c.tar.gz |
Introduce Knative Serverless Tab
Diffstat (limited to 'app/models/clusters/cluster.rb')
-rw-r--r-- | app/models/clusters/cluster.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/clusters/cluster.rb b/app/models/clusters/cluster.rb index c9bd1728dbd..7fe43cd2de0 100644 --- a/app/models/clusters/cluster.rb +++ b/app/models/clusters/cluster.rb @@ -93,6 +93,16 @@ module Clusters where('NOT EXISTS (?)', subquery) end + scope :with_knative_installed, -> { joins(:application_knative).merge(Clusters::Applications::Knative.installed) } + + scope :preload_knative, -> { + preload( + :kubernetes_namespace, + :platform_kubernetes, + :application_knative + ) + } + def self.ancestor_clusters_for_clusterable(clusterable, hierarchy_order: :asc) hierarchy_groups = clusterable.ancestors_upto(hierarchy_order: hierarchy_order).eager_load(:clusters) hierarchy_groups = hierarchy_groups.merge(current_scope) if current_scope |