debian-mirror-gitlab/lib/gitlab/prometheus/query_variables.rb

20 lines
543 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
module Gitlab
module Prometheus
module QueryVariables
def self.call(environment)
2019-07-31 22:56:46 +05:30
deployment_platform = environment.deployment_platform
namespace = deployment_platform&.namespace_for(environment.project) ||
deployment_platform&.actual_namespace || ''
2019-02-15 15:39:39 +05:30
{
ci_environment_slug: environment.slug,
2019-07-31 22:56:46 +05:30
kube_namespace: namespace,
2019-02-15 15:39:39 +05:30
environment_filter: %{container_name!="POD",environment="#{environment.slug}"}
}
end
end
end
end