diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-03-26 16:14:23 -0600 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-03-26 16:59:27 -0600 |
commit | 1a79beff6ea15c8ce37bc461103d6a5f46ff2955 (patch) | |
tree | d65f40626243093e5b90067ea9205742c45d3ba4 | |
parent | ca59bfdc6657fc20a27e93f41fc9e38c41498389 (diff) | |
download | gitlab-ce-1a79beff6ea15c8ce37bc461103d6a5f46ff2955.tar.gz |
Re-arrange deployment_platform to avoid cop complainments5347-fix-multiple-clusters-incorrect-details-injected
-rw-r--r-- | app/models/concerns/deployment_platform.rb | 14 |
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 |