diff options
author | Peter Leitzen <pleitzen@gitlab.com> | 2019-04-27 17:35:32 +0300 |
---|---|---|
committer | Peter Leitzen <pleitzen@gitlab.com> | 2019-04-29 13:21:15 +0300 |
commit | de69a808a015514fa7e4451f406fcc3d73734919 (patch) | |
tree | a8d03e5d7ef25b4810a56e73aa452795b805ebc0 /app/models/clusters/platforms/kubernetes.rb | |
parent | ab9910f7a5fe4981b330c3886865397fd066108d (diff) |
Use correct k8s namespace in Prometheus queries
Before this commit the wrong namespace could have been used in
Prometheus queries for group-level installations.
Diffstat (limited to 'app/models/clusters/platforms/kubernetes.rb')
-rw-r--r-- | app/models/clusters/platforms/kubernetes.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/clusters/platforms/kubernetes.rb b/app/models/clusters/platforms/kubernetes.rb index a806367a49b..94a6b224113 100644 --- a/app/models/clusters/platforms/kubernetes.rb +++ b/app/models/clusters/platforms/kubernetes.rb @@ -76,6 +76,10 @@ module Clusters end end + def namespace_for(project) + cluster.find_or_initialize_kubernetes_namespace_for_project(project)&.namespace + end + def predefined_variables(project:) Gitlab::Ci::Variables::Collection.new.tap do |variables| variables.append(key: 'KUBE_URL', value: api_url) |