diff options
author | Thong Kuah <tkuah@gitlab.com> | 2018-11-27 07:30:09 +0300 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2018-12-04 05:44:33 +0300 |
commit | a97d8767514c6fc1e314a2b83260a8dad5a7e1f2 (patch) | |
tree | bb7a82fc2b4df4ff69ab08f3b620cc6a63849f7e /app/models/clusters/platforms/kubernetes.rb | |
parent | 76d4e6d6d87f3e59f1864fa15da701bb789e301e (diff) |
Fallback to admin token for project clusters only
We do not want group level clusters to fall back to what was old
behaviour for project level clusters. So instead we will not return any
KUBE_TOKEN if we cannot find a suitable kubernetes_namespace for the
project, in the group level cluster case.
Add test cases to assert above
Diffstat (limited to 'app/models/clusters/platforms/kubernetes.rb')
-rw-r--r-- | app/models/clusters/platforms/kubernetes.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/clusters/platforms/kubernetes.rb b/app/models/clusters/platforms/kubernetes.rb index 3c5d7756eec..dc8b52105cc 100644 --- a/app/models/clusters/platforms/kubernetes.rb +++ b/app/models/clusters/platforms/kubernetes.rb @@ -85,7 +85,7 @@ module Clusters if kubernetes_namespace = cluster.kubernetes_namespaces.has_service_account_token.find_by(project: project) variables.concat(kubernetes_namespace.predefined_variables) - else + elsif cluster.project_type? # From 11.5, every Clusters::Project should have at least one # Clusters::KubernetesNamespace, so once migration has been completed, # this 'else' branch will be removed. For more information, please see |