Commit 0aeef733 authored by James Fargher's avatar James Fargher

Convert instance level clusters enabled to class method

parent c40a99a0
......@@ -10,7 +10,7 @@ module Clusters
::Feature.enabled?(feature, default_enabled: true)
end
def instance_clusters_enabled?
def self.enabled?
::Feature.enabled?(:instance_clusters, default_enabled: true)
end
end
......
......@@ -38,7 +38,7 @@ module DeploymentPlatform
end
def find_instance_cluster_platform_kubernetes_with_feature_guard(environment: nil)
return unless instance_clusters_enabled?
return unless Clusters::Instance.enabled?
find_instance_cluster_platform_kubernetes(environment: environment)
end
......@@ -49,10 +49,6 @@ module DeploymentPlatform
.first&.platform_kubernetes
end
def instance_clusters_enabled?
Feature.enabled?(:instance_clusters, default_enabled: true)
end
def find_kubernetes_service_integration
services.deployment.reorder(nil).find_by(active: true)
end
......
......@@ -6,7 +6,7 @@ module Clusters
condition(:has_clusters, scope: :subject) { clusterable_has_clusters? }
condition(:can_have_multiple_clusters) { multiple_clusters_available? }
condition(:instance_clusters_enabled, scope: :subject) { @subject.instance_clusters_enabled? }
condition(:instance_clusters_enabled) { Instance.enabled? }
rule { admin & instance_clusters_enabled }.policy do
enable :read_cluster
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment