diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-04-30 16:31:47 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-04-30 16:31:47 +0300 |
commit | 56c8b35b8460dac53e6d29c3c811da4e57eca66c (patch) | |
tree | 566efb71c8385a474c8ca08e4401a2782067557e /lib | |
parent | ac2c2be97f1a0647630646ebf1e25f9bb0fb5ac9 (diff) | |
parent | b389ef66d46219abbd671bcdbdfdd2fb142798b8 (diff) |
Merge branch 'pl-fix-k8s-ns-query-variables' into 'master'
Use correct k8s namespace in Prometheus queries
See merge request gitlab-org/gitlab-ce!27812
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/prometheus/query_variables.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/prometheus/query_variables.rb b/lib/gitlab/prometheus/query_variables.rb index 1cc85d4b4a6..dca09aef47d 100644 --- a/lib/gitlab/prometheus/query_variables.rb +++ b/lib/gitlab/prometheus/query_variables.rb @@ -4,9 +4,13 @@ module Gitlab module Prometheus module QueryVariables def self.call(environment) + deployment_platform = environment.deployment_platform + namespace = deployment_platform&.namespace_for(environment.project) || + deployment_platform&.actual_namespace || '' + { ci_environment_slug: environment.slug, - kube_namespace: environment.deployment_platform&.actual_namespace || '', + kube_namespace: namespace, environment_filter: %{container_name!="POD",environment="#{environment.slug}"} } end |