summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20190517153211_migrate_k8s_service_integration.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/db/post_migrate/20190517153211_migrate_k8s_service_integration.rb b/db/post_migrate/20190517153211_migrate_k8s_service_integration.rb
index f9f13d64be9..4bd04edb239 100644
--- a/db/post_migrate/20190517153211_migrate_k8s_service_integration.rb
+++ b/db/post_migrate/20190517153211_migrate_k8s_service_integration.rb
@@ -75,11 +75,13 @@ class MigrateK8sServiceIntegration < ActiveRecord::Migration[5.1]
end
def up
+ has_instance_cluster = Cluster.instance_type.where(enabled: true).exists?
+
MigrateK8sServiceIntegration::Service.kubernetes_service_templates.find_each do |service|
next unless service.api_url && service.token
MigrateK8sServiceIntegration::Cluster.create!(
- enabled: service.active,
+ enabled: !has_instance_cluster && service.active,
managed: false,
name: 'KubernetesService',
cluster_type: 'instance_type',