Ver Fonte

Remove unnecessary labelconfig from asset filters

Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Michael Dresser há 2 anos atrás
pai
commit
9ae3659a60
2 ficheiros alterados com 2 adições e 7 exclusões
  1. 2 6
      pkg/util/filterutil/asset_test.go
  2. 0 1
      pkg/util/filterutil/filterutil.go

+ 2 - 6
pkg/util/filterutil/asset_test.go

@@ -8,7 +8,7 @@ import (
 	"github.com/opencost/opencost/pkg/util/mapper"
 )
 
-var assetCompiler = kubecost.NewAssetMatchCompiler(nil)
+var assetCompiler = kubecost.NewAssetMatchCompiler()
 
 func TestAssetFiltersFromParamsV1(t *testing.T) {
 	cases := []struct {
@@ -423,10 +423,6 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			}
 			qpMapper := mapper.NewMapper(qpMap)
 
-			labelConfig := kubecost.LabelConfig{}
-			labelConfig.DepartmentLabel = "internal-product-umbrella"
-			labelConfig.OwnerLabel = "testowner"
-
 			clustersMap := mockClusterMap{
 				m: map[string]*clusters.ClusterInfo{
 					"mapped-cluster-ID-1": {
@@ -436,7 +432,7 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 				},
 			}
 
-			filterTree := AssetFilterFromParamsV1(qpMapper, &labelConfig, clustersMap)
+			filterTree := AssetFilterFromParamsV1(qpMapper, clustersMap)
 			filter, err := assetCompiler.Compile(filterTree)
 			if err != nil {
 				t.Fatalf("compiling filter: %s", err)

+ 0 - 1
pkg/util/filterutil/filterutil.go

@@ -357,7 +357,6 @@ func AllocationFilterFromParamsV1(
 
 func AssetFilterFromParamsV1(
 	qp mapper.PrimitiveMapReader,
-	labelConfig *kubecost.LabelConfig,
 	clusterMap clusters.ClusterMap,
 ) filter.Filter {