mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-07 10:17:51 +00:00
Adds additional test case for alternate attached namespace scenario
This commit is contained in:
parent
dce5b81642
commit
990b69efba
1 changed files with 15 additions and 0 deletions
|
|
@ -372,6 +372,21 @@ func TestBuildExternalSelector(t *testing.T) {
|
||||||
hasSelector(`foo="bar",namespaces="default"`),
|
hasSelector(`foo="bar",namespaces="default"`),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "single LabelMatchers value with namespace alt - explicit attached namespace",
|
||||||
|
|
||||||
|
mq: mustNewQuery(`<<.LabelMatchers>>`),
|
||||||
|
namespace: "staging",
|
||||||
|
options: config.Options{DetatchFromNamespace: false},
|
||||||
|
metricSelector: labels.NewSelector().Add(
|
||||||
|
*mustNewLabelRequirement("foo", selection.Equals, []string{"bar"}),
|
||||||
|
),
|
||||||
|
|
||||||
|
check: checks(
|
||||||
|
hasError(nil),
|
||||||
|
hasSelector(`foo="bar",namespaces="staging"`),
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "multiple LabelMatchers value",
|
name: "multiple LabelMatchers value",
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue