summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2019-06-25 16:24:54 +1200
committerThong Kuah <tkuah@gitlab.com>2019-06-27 17:28:52 +1200
commit2cdb72ea0382ef80f6cd24606826094321a4e643 (patch)
treef343a7c2523fe4b258cfee897286c19cdb4ba7ea /lib
parent2f96e5d3b9e750c5faef1fc8d95b18cb02002516 (diff)
downloadgitlab-ce-2cdb72ea0382ef80f6cd24606826094321a4e643.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb b/lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb
index 49c680605ea..48598fcae7e 100644
--- a/lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb
+++ b/lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb
@@ -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