summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2018-03-26 16:14:23 -0600
committerMayra Cabrera <mcabrera@gitlab.com>2018-03-26 16:59:27 -0600
commit1a79beff6ea15c8ce37bc461103d6a5f46ff2955 (patch)
treed65f40626243093e5b90067ea9205742c45d3ba4
parentca59bfdc6657fc20a27e93f41fc9e38c41498389 (diff)
downloadgitlab-ce-5347-fix-multiple-clusters-incorrect-details-injected.tar.gz
Re-arrange deployment_platform to avoid cop complainments5347-fix-multiple-clusters-incorrect-details-injected
-rw-r--r--app/models/concerns/deployment_platform.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/app/models/concerns/deployment_platform.rb b/app/models/concerns/deployment_platform.rb
index 6ddfc7b0d7b..52851b3d0b2 100644
--- a/app/models/concerns/deployment_platform.rb
+++ b/app/models/concerns/deployment_platform.rb
@@ -1,14 +1,20 @@
module DeploymentPlatform
# EE would override this and utilize environment argument
+ # rubocop:disable Gitlab/ModuleWithInstanceVariables
def deployment_platform(environment: nil)
- @deployment_platform ||=
- find_cluster_platform_kubernetes(environment: environment) ||
- find_kubernetes_service_integration ||
- build_cluster_and_deployment_platform
+ @deployment_platform ||= {}
+
+ @deployment_platform[environment] ||= find_deployment_platform(environment)
end
private
+ def find_deployment_platform(environment)
+ find_cluster_platform_kubernetes(environment: environment) ||
+ find_kubernetes_service_integration ||
+ build_cluster_and_deployment_platform
+ end
+
# EE would override this and utilize environment argument
def find_cluster_platform_kubernetes(environment: nil)
clusters.enabled.default_environment