Skip to content

Resolve "Multiple clusters: incorrect cluster details injected - environment scope is ignored"

What does this MR do?

Resolves incorrect output of deployment_platform when the Project has multiple clusters and multiple environments

Why was this MR needed?

Same kubernetes_platform was being returned on deployment_platform method, completely ignoring the environment argument on EE. This was resolved by rearranging DeploymentPlatform methods in the following way:

  • Change find_cluster_platform_kubernetes to search for a specific environment on EE, and ignore environment argument on CE
  • Override find_cluster_platform_kubernetes and deployment_platform methods
  • Remove memoization from deployment_platform on EE, otherwise when searching for another platform, once the first one is assigned, environment parameter is completely ignored

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #5347 (closed)

CE Port: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17904

Edited by Kamil Trzciński

Merge request reports