diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/concerns/deployment_platform.rb | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/app/models/concerns/deployment_platform.rb b/app/models/concerns/deployment_platform.rb index 9ac0d612db3..1bd8a799f0d 100644 --- a/app/models/concerns/deployment_platform.rb +++ b/app/models/concerns/deployment_platform.rb @@ -14,9 +14,7 @@ module DeploymentPlatform def find_deployment_platform(environment) find_cluster_platform_kubernetes(environment: environment) || find_group_cluster_platform_kubernetes_with_feature_guard(environment: environment) || - find_instance_cluster_platform_kubernetes_with_feature_guard(environment: environment) || - find_kubernetes_service_integration || - build_cluster_and_deployment_platform + find_instance_cluster_platform_kubernetes_with_feature_guard(environment: environment) end # EE would override this and utilize environment argument @@ -48,39 +46,4 @@ module DeploymentPlatform Clusters::Instance.new.clusters.enabled.default_environment .first&.platform_kubernetes end - - def find_kubernetes_service_integration - services.deployment.reorder(nil).find_by(active: true) - end - - def build_cluster_and_deployment_platform - return unless kubernetes_service_template - - cluster = ::Clusters::Cluster.create(cluster_attributes_from_service_template) - cluster.platform_kubernetes if cluster.persisted? - end - - def kubernetes_service_template - @kubernetes_service_template ||= KubernetesService.active.find_by_template - end - - def cluster_attributes_from_service_template - { - name: 'kubernetes-template', - projects: [self], - cluster_type: :project_type, - provider_type: :user, - platform_type: :kubernetes, - platform_kubernetes_attributes: platform_kubernetes_attributes_from_service_template - } - end - - def platform_kubernetes_attributes_from_service_template - { - api_url: kubernetes_service_template.api_url, - ca_pem: kubernetes_service_template.ca_pem, - token: kubernetes_service_template.token, - namespace: kubernetes_service_template.namespace - } - end end |