Convert instance level clusters enabled to class method
This commit is contained in:
parent
c40a99a058
commit
0aeef7335f
3 changed files with 3 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue