Use deployment's cluster for kubernetes prereq

A deployment will have a cluster associated on creation if there is one.

Otherwise fallback to deployment_platform for legacy deployments.
This commit is contained in:
Thong Kuah 2019-06-25 16:24:54 +12:00
parent 2f96e5d3b9
commit 2cdb72ea03

View file

@ -20,7 +20,9 @@ module Gitlab
private
def deployment_cluster
build.deployment&.deployment_platform_cluster
strong_memoize(:deployment_cluster) do
build.deployment&.cluster || build.deployment&.deployment_platform_cluster
end
end
def kubernetes_namespace