|
|
@@ -365,21 +365,21 @@ func TestFiltersFromParamsV1(t *testing.T) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- name: "single department",
|
|
|
+ name: "single department, sanitization required",
|
|
|
qp: map[string]string{
|
|
|
"filterDepartments": "pa-1",
|
|
|
},
|
|
|
shouldMatch: []kubecost.Allocation{
|
|
|
allocGenerator(kubecost.AllocationProperties{
|
|
|
Labels: map[string]string{
|
|
|
- "internal-product-umbrella": "pa-1",
|
|
|
+ "internal_product_umbrella": "pa-1",
|
|
|
},
|
|
|
}),
|
|
|
},
|
|
|
shouldNotMatch: []kubecost.Allocation{
|
|
|
allocGenerator(kubecost.AllocationProperties{
|
|
|
Labels: map[string]string{
|
|
|
- "internal-product-umbrella": "ps-N",
|
|
|
+ "internal_product_umbrella": "ps-N",
|
|
|
},
|
|
|
}),
|
|
|
},
|
|
|
@@ -392,34 +392,34 @@ func TestFiltersFromParamsV1(t *testing.T) {
|
|
|
shouldMatch: []kubecost.Allocation{
|
|
|
allocGenerator(kubecost.AllocationProperties{
|
|
|
Labels: map[string]string{
|
|
|
- "internal-product-umbrella": "pa-1",
|
|
|
+ "internal_product_umbrella": "pa-1",
|
|
|
},
|
|
|
}),
|
|
|
},
|
|
|
shouldNotMatch: []kubecost.Allocation{
|
|
|
allocGenerator(kubecost.AllocationProperties{
|
|
|
Labels: map[string]string{
|
|
|
- "internal-product-umbrella": "ps-N",
|
|
|
+ "internal_product_umbrella": "ps-N",
|
|
|
},
|
|
|
}),
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- name: "single label",
|
|
|
+ name: "single label, sanitization required",
|
|
|
qp: map[string]string{
|
|
|
- "filterLabels": "app:cost-analyzer",
|
|
|
+ "filterLabels": "app-a:cost-analyzer",
|
|
|
},
|
|
|
shouldMatch: []kubecost.Allocation{
|
|
|
allocGenerator(kubecost.AllocationProperties{
|
|
|
Labels: map[string]string{
|
|
|
- "app": "cost-analyzer",
|
|
|
+ "app_a": "cost-analyzer",
|
|
|
},
|
|
|
}),
|
|
|
},
|
|
|
shouldNotMatch: []kubecost.Allocation{
|
|
|
allocGenerator(kubecost.AllocationProperties{
|
|
|
Labels: map[string]string{
|
|
|
- "app": "foo",
|
|
|
+ "app_a": "foo",
|
|
|
},
|
|
|
}),
|
|
|
allocGenerator(kubecost.AllocationProperties{
|