Parcourir la source

Rename core/pkg/kubecost => core/pkg/opencost

Signed-off-by: Matt Bolt <mbolt35@gmail.com>
Matt Bolt il y a 2 ans
Parent
commit
67fdc248b5
100 fichiers modifiés avec 1171 ajouts et 1168 suppressions
  1. 20 20
      core/pkg/filter/legacy/cloudcost/cloudcost.go
  2. 235 235
      core/pkg/filter/legacy/filter_test.go
  3. 2 2
      core/pkg/filter/legacy/window.go
  4. 11 11
      core/pkg/filter/legacy/window_test.go
  5. 1 1
      core/pkg/opencost/allocation.go
  6. 1 1
      core/pkg/opencost/allocation_json.go
  7. 1 1
      core/pkg/opencost/allocation_json_test.go
  8. 6 7
      core/pkg/opencost/allocation_test.go
  9. 1 1
      core/pkg/opencost/allocationfilter_test.go
  10. 1 1
      core/pkg/opencost/allocationmatcher.go
  11. 1 1
      core/pkg/opencost/allocationmatcher_test.go
  12. 1 1
      core/pkg/opencost/allocationprops.go
  13. 1 1
      core/pkg/opencost/allocationprops_test.go
  14. 1 1
      core/pkg/opencost/asset.go
  15. 1 1
      core/pkg/opencost/asset_json.go
  16. 1 1
      core/pkg/opencost/asset_json_test.go
  17. 1 1
      core/pkg/opencost/asset_test.go
  18. 1 1
      core/pkg/opencost/assetmatcher.go
  19. 1 1
      core/pkg/opencost/assetprops.go
  20. 2 2
      core/pkg/opencost/bingen.go
  21. 1 1
      core/pkg/opencost/cloudcost.go
  22. 1 1
      core/pkg/opencost/cloudcost_test.go
  23. 1 1
      core/pkg/opencost/cloudcostmatcher.go
  24. 1 1
      core/pkg/opencost/cloudcostprops.go
  25. 1 1
      core/pkg/opencost/cloudcostprops_test.go
  26. 1 1
      core/pkg/opencost/cloudusage.go
  27. 1 1
      core/pkg/opencost/common.go
  28. 1 1
      core/pkg/opencost/config.go
  29. 1 1
      core/pkg/opencost/config_test.go
  30. 1 1
      core/pkg/opencost/costmetric.go
  31. 1 1
      core/pkg/opencost/coverage.go
  32. 1 1
      core/pkg/opencost/diff_test.go
  33. 1 1
      core/pkg/opencost/json.go
  34. 1 1
      core/pkg/opencost/mock.go
  35. 6 2
      core/pkg/opencost/opencost_codecs.go
  36. 1 1
      core/pkg/opencost/opencost_codecs_test.go
  37. 1 1
      core/pkg/opencost/query.go
  38. 1 1
      core/pkg/opencost/status.go
  39. 1 1
      core/pkg/opencost/summaryallocation.go
  40. 1 1
      core/pkg/opencost/summaryallocation_json.go
  41. 1 1
      core/pkg/opencost/summaryallocation_json_test.go
  42. 1 1
      core/pkg/opencost/summaryallocation_test.go
  43. 1 1
      core/pkg/opencost/totals.go
  44. 1 1
      core/pkg/opencost/totals_json.go
  45. 1 1
      core/pkg/opencost/totals_test.go
  46. 1 1
      core/pkg/opencost/window.go
  47. 1 1
      core/pkg/opencost/window_test.go
  48. 170 170
      core/pkg/util/filterutil/asset_test.go
  49. 25 25
      core/pkg/util/filterutil/filterparams.go
  50. 2 2
      core/pkg/util/filterutil/filterutil.go
  51. 166 166
      core/pkg/util/filterutil/queryfilters_test.go
  52. 2 2
      pkg/cloud/alibaba/boaconfiguration.go
  53. 9 9
      pkg/cloud/alibaba/boaquerier.go
  54. 2 2
      pkg/cloud/alibaba/provider.go
  55. 2 2
      pkg/cloud/aws/athenaconfiguration.go
  56. 16 16
      pkg/cloud/aws/athenaintegration.go
  57. 10 10
      pkg/cloud/aws/athenaquerier.go
  58. 2 2
      pkg/cloud/aws/provider.go
  59. 2 2
      pkg/cloud/aws/s3configuration.go
  60. 14 14
      pkg/cloud/aws/s3selectintegration.go
  61. 12 12
      pkg/cloud/azure/azurestorageintegration.go
  62. 10 10
      pkg/cloud/azure/billingexportparser.go
  63. 2 2
      pkg/cloud/azure/provider.go
  64. 2 2
      pkg/cloud/azure/storageconfiguration.go
  65. 2 2
      pkg/cloud/config/mock.go
  66. 2 2
      pkg/cloud/gcp/bigqueryconfiguration.go
  67. 3 3
      pkg/cloud/gcp/bigqueryintegration.go
  68. 2 2
      pkg/cloud/gcp/bigqueryintegration_test.go
  69. 12 12
      pkg/cloud/gcp/bigqueryintegration_types.go
  70. 20 20
      pkg/cloud/gcp/cloudcost.go
  71. 2 2
      pkg/cloud/gcp/provider.go
  72. 2 2
      pkg/cloud/provider/customprovider.go
  73. 13 13
      pkg/cloud/provider/provider.go
  74. 2 2
      pkg/cloud/scaleway/provider.go
  75. 7 7
      pkg/cloudcost/ingestionmanager.go
  76. 17 17
      pkg/cloudcost/ingestor.go
  77. 2 2
      pkg/cloudcost/integration.go
  78. 6 6
      pkg/cloudcost/memoryrepository.go
  79. 43 43
      pkg/cloudcost/memoryrepository_test.go
  80. 21 21
      pkg/cloudcost/mock.go
  81. 3 3
      pkg/cloudcost/pipelineservice.go
  82. 4 4
      pkg/cloudcost/querier.go
  83. 2 2
      pkg/cloudcost/queryservice.go
  84. 17 17
      pkg/cloudcost/queryservice_helper.go
  85. 9 9
      pkg/cloudcost/queryservice_helper_test.go
  86. 3 3
      pkg/cloudcost/repository.go
  87. 5 5
      pkg/cloudcost/repositoryquerier.go
  88. 27 27
      pkg/costmodel/aggregation.go
  89. 6 6
      pkg/costmodel/aggregation_test.go
  90. 15 15
      pkg/costmodel/allocation.go
  91. 43 43
      pkg/costmodel/allocation_helpers.go
  92. 33 33
      pkg/costmodel/allocation_helpers_test.go
  93. 9 9
      pkg/costmodel/allocation_incubating.go
  94. 6 6
      pkg/costmodel/allocation_types.go
  95. 16 16
      pkg/costmodel/assets.go
  96. 9 9
      pkg/costmodel/cluster.go
  97. 2 2
      pkg/costmodel/cluster_helpers.go
  98. 2 2
      pkg/costmodel/cluster_helpers_test.go
  99. 31 31
      pkg/costmodel/costmodel.go
  100. 3 3
      pkg/costmodel/csv_export.go

+ 20 - 20
core/pkg/filter/legacy/cloudcost/cloudcost.go

@@ -5,8 +5,8 @@ import (
 	"strings"
 
 	filter "github.com/opencost/opencost/core/pkg/filter/legacy"
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/mapper"
 )
 
@@ -33,7 +33,7 @@ func parseWildcardEnd(rawFilterValue string) (string, bool) {
 	return strings.TrimSuffix(rawFilterValue, "*"), strings.HasSuffix(rawFilterValue, "*")
 }
 
-func CloudCostFilterFromParams(pmr mapper.PrimitiveMapReader) filter.Filter[*kubecost.CloudCost] {
+func CloudCostFilterFromParams(pmr mapper.PrimitiveMapReader) filter.Filter[*opencost.CloudCost] {
 	ccFilter := convertFilterQueryParams(pmr)
 	return ParseCloudCostFilter(ccFilter)
 }
@@ -49,37 +49,37 @@ func convertFilterQueryParams(pmr mapper.PrimitiveMapReader) CloudCostFilter {
 		Services:         pmr.GetList("filterServices", ","),
 	}
 }
-func ParseCloudCostFilter(filters CloudCostFilter) filter.Filter[*kubecost.CloudCost] {
-	result := filter.And[*kubecost.CloudCost]{
-		Filters: []filter.Filter[*kubecost.CloudCost]{},
+func ParseCloudCostFilter(filters CloudCostFilter) filter.Filter[*opencost.CloudCost] {
+	result := filter.And[*opencost.CloudCost]{
+		Filters: []filter.Filter[*opencost.CloudCost]{},
 	}
 
 	if len(filters.InvoiceEntityIDs) > 0 {
-		result.Filters = append(result.Filters, filterV1SingleValueFromList(filters.InvoiceEntityIDs, kubecost.CloudCostInvoiceEntityIDProp))
+		result.Filters = append(result.Filters, filterV1SingleValueFromList(filters.InvoiceEntityIDs, opencost.CloudCostInvoiceEntityIDProp))
 	}
 
 	if len(filters.AccountIDs) > 0 {
-		result.Filters = append(result.Filters, filterV1SingleValueFromList(filters.AccountIDs, kubecost.CloudCostAccountIDProp))
+		result.Filters = append(result.Filters, filterV1SingleValueFromList(filters.AccountIDs, opencost.CloudCostAccountIDProp))
 	}
 
 	if len(filters.Providers) > 0 {
-		result.Filters = append(result.Filters, filterV1SingleValueFromList(filters.Providers, kubecost.CloudCostProviderProp))
+		result.Filters = append(result.Filters, filterV1SingleValueFromList(filters.Providers, opencost.CloudCostProviderProp))
 	}
 
 	if len(filters.ProviderIDs) > 0 {
-		result.Filters = append(result.Filters, filterV1SingleValueFromList(filters.ProviderIDs, kubecost.CloudCostProviderIDProp))
+		result.Filters = append(result.Filters, filterV1SingleValueFromList(filters.ProviderIDs, opencost.CloudCostProviderIDProp))
 	}
 
 	if len(filters.Services) > 0 {
-		result.Filters = append(result.Filters, filterV1SingleValueFromList(filters.Services, kubecost.CloudCostServiceProp))
+		result.Filters = append(result.Filters, filterV1SingleValueFromList(filters.Services, opencost.CloudCostServiceProp))
 	}
 
 	if len(filters.Categories) > 0 {
-		result.Filters = append(result.Filters, filterV1SingleValueFromList(filters.Categories, kubecost.CloudCostCategoryProp))
+		result.Filters = append(result.Filters, filterV1SingleValueFromList(filters.Categories, opencost.CloudCostCategoryProp))
 	}
 
 	if len(filters.Labels) > 0 {
-		result.Filters = append(result.Filters, filterV1DoubleValueFromList(filters.Labels, kubecost.CloudCostLabelProp))
+		result.Filters = append(result.Filters, filterV1DoubleValueFromList(filters.Labels, opencost.CloudCostLabelProp))
 	}
 
 	if len(result.Filters) == 0 {
@@ -89,16 +89,16 @@ func ParseCloudCostFilter(filters CloudCostFilter) filter.Filter[*kubecost.Cloud
 	return result
 }
 
-func filterV1SingleValueFromList(rawFilterValues []string, field string) filter.Filter[*kubecost.CloudCost] {
-	result := filter.Or[*kubecost.CloudCost]{
-		Filters: []filter.Filter[*kubecost.CloudCost]{},
+func filterV1SingleValueFromList(rawFilterValues []string, field string) filter.Filter[*opencost.CloudCost] {
+	result := filter.Or[*opencost.CloudCost]{
+		Filters: []filter.Filter[*opencost.CloudCost]{},
 	}
 
 	for _, filterValue := range rawFilterValues {
 		filterValue = strings.TrimSpace(filterValue)
 		filterValue, wildcard := parseWildcardEnd(filterValue)
 
-		subFilter := filter.StringProperty[*kubecost.CloudCost]{
+		subFilter := filter.StringProperty[*opencost.CloudCost]{
 			Field: field,
 			Op:    filter.StringEquals,
 			Value: filterValue,
@@ -119,9 +119,9 @@ func filterV1SingleValueFromList(rawFilterValues []string, field string) filter.
 //
 // The v1 query language (e.g. "filterLabels=app:foo,l2:bar") uses OR within
 // a field (e.g. label[app] = foo OR label[l2] = bar)
-func filterV1DoubleValueFromList(rawFilterValuesUnsplit []string, filterField string) filter.Filter[*kubecost.CloudCost] {
-	result := filter.Or[*kubecost.CloudCost]{
-		Filters: []filter.Filter[*kubecost.CloudCost]{},
+func filterV1DoubleValueFromList(rawFilterValuesUnsplit []string, filterField string) filter.Filter[*opencost.CloudCost] {
+	result := filter.Or[*opencost.CloudCost]{
+		Filters: []filter.Filter[*opencost.CloudCost]{},
 	}
 
 	for _, unsplit := range rawFilterValuesUnsplit {
@@ -135,7 +135,7 @@ func filterV1DoubleValueFromList(rawFilterValuesUnsplit []string, filterField st
 			val := strings.TrimSpace(split[1])
 			val, wildcard := parseWildcardEnd(val)
 
-			subFilter := filter.StringMapProperty[*kubecost.CloudCost]{
+			subFilter := filter.StringMapProperty[*opencost.CloudCost]{
 				Field: filterField,
 				// All v1 filters are equality comparisons
 				Op:    filter.StringMapEquals,

Fichier diff supprimé car celui-ci est trop grand
+ 235 - 235
core/pkg/filter/legacy/filter_test.go


+ 2 - 2
core/pkg/filter/legacy/window.go

@@ -8,7 +8,7 @@ package legacy
 //)
 //
 //type Windowed interface {
-//	GetWindow() kubecost.Window
+//	GetWindow() opencost.Window
 //}
 //
 //// WindowOperation are operations that can be performed on types that have windows
@@ -20,7 +20,7 @@ package legacy
 //
 //// WindowCondition is a filter can be used on any type that has a window and implements GetWindow()
 //type WindowCondition[T Windowed] struct {
-//	Window kubecost.Window
+//	Window opencost.Window
 //	Op     WindowOperation
 //}
 //

+ 11 - 11
core/pkg/filter/legacy/window_test.go

@@ -7,15 +7,15 @@ package legacy_test
 // )
 
 // type windowedImpl struct {
-// 	kubecost.Window
+// 	opencost.Window
 // }
 
-// func (w *windowedImpl) GetWindow() kubecost.Window {
+// func (w *windowedImpl) GetWindow() opencost.Window {
 // 	return w.Window
 // }
 
 // func newWindowedImpl(start, end *time.Time) *windowedImpl {
-// 	return &windowedImpl{kubecost.NewWindow(start, end)}
+// 	return &windowedImpl{opencost.NewWindow(start, end)}
 // }
 
 // func Test_WindowContains_Matches(t *testing.T) {
@@ -31,7 +31,7 @@ package legacy_test
 // 		"fully contains": {
 // 			windowed: newWindowedImpl(&one, &two),
 // 			filter: WindowCondition[*windowedImpl]{
-// 				Window: kubecost.NewWindow(&noon, &three),
+// 				Window: opencost.NewWindow(&noon, &three),
 // 				Op:     WindowContains,
 // 			},
 
@@ -40,7 +40,7 @@ package legacy_test
 // 		"window matches": {
 // 			windowed: newWindowedImpl(&one, &two),
 // 			filter: WindowCondition[*windowedImpl]{
-// 				Window: kubecost.NewWindow(&one, &two),
+// 				Window: opencost.NewWindow(&one, &two),
 // 				Op:     WindowContains,
 // 			},
 
@@ -49,7 +49,7 @@ package legacy_test
 // 		"contains start": {
 // 			windowed: newWindowedImpl(&one, &three),
 // 			filter: WindowCondition[*windowedImpl]{
-// 				Window: kubecost.NewWindow(&noon, &two),
+// 				Window: opencost.NewWindow(&noon, &two),
 // 				Op:     WindowContains,
 // 			},
 
@@ -58,7 +58,7 @@ package legacy_test
 // 		"contains end": {
 // 			windowed: newWindowedImpl(&noon, &two),
 // 			filter: WindowCondition[*windowedImpl]{
-// 				Window: kubecost.NewWindow(&one, &three),
+// 				Window: opencost.NewWindow(&one, &three),
 // 				Op:     WindowContains,
 // 			},
 
@@ -67,7 +67,7 @@ package legacy_test
 // 		"window start = filter end": {
 // 			windowed: newWindowedImpl(&one, &two),
 // 			filter: WindowCondition[*windowedImpl]{
-// 				Window: kubecost.NewWindow(&noon, &one),
+// 				Window: opencost.NewWindow(&noon, &one),
 // 				Op:     WindowContains,
 // 			},
 
@@ -76,7 +76,7 @@ package legacy_test
 // 		"window end = filter start": {
 // 			windowed: newWindowedImpl(&noon, &one),
 // 			filter: WindowCondition[*windowedImpl]{
-// 				Window: kubecost.NewWindow(&one, &two),
+// 				Window: opencost.NewWindow(&one, &two),
 // 				Op:     WindowContains,
 // 			},
 
@@ -85,7 +85,7 @@ package legacy_test
 // 		"window before": {
 // 			windowed: newWindowedImpl(&noon, &one),
 // 			filter: WindowCondition[*windowedImpl]{
-// 				Window: kubecost.NewWindow(&two, &three),
+// 				Window: opencost.NewWindow(&two, &three),
 // 				Op:     WindowContains,
 // 			},
 
@@ -94,7 +94,7 @@ package legacy_test
 // 		"window after": {
 // 			windowed: newWindowedImpl(&two, &three),
 // 			filter: WindowCondition[*windowedImpl]{
-// 				Window: kubecost.NewWindow(&noon, &one),
+// 				Window: opencost.NewWindow(&noon, &one),
 // 				Op:     WindowContains,
 // 			},
 

+ 1 - 1
core/pkg/kubecost/allocation.go → core/pkg/opencost/allocation.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"fmt"

+ 1 - 1
core/pkg/kubecost/allocation_json.go → core/pkg/opencost/allocation_json.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"fmt"

+ 1 - 1
core/pkg/kubecost/allocation_json_test.go → core/pkg/opencost/allocation_json_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"encoding/json"

+ 6 - 7
core/pkg/kubecost/allocation_test.go → core/pkg/opencost/allocation_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"fmt"
@@ -9,9 +9,8 @@ import (
 	"time"
 
 	"github.com/davecgh/go-spew/spew"
-	filter21 "github.com/opencost/opencost/core/pkg/filter"
+	"github.com/opencost/opencost/core/pkg/filter"
 	"github.com/opencost/opencost/core/pkg/filter/allocation"
-	afilter "github.com/opencost/opencost/core/pkg/filter/allocation"
 	"github.com/opencost/opencost/core/pkg/filter/ast"
 	"github.com/opencost/opencost/core/pkg/filter/ops"
 	"github.com/opencost/opencost/core/pkg/log"
@@ -20,12 +19,12 @@ import (
 	"github.com/opencost/opencost/core/pkg/util/timeutil"
 )
 
-var filterParser = afilter.NewAllocationFilterParser()
+var filterParser = allocation.NewAllocationFilterParser()
 var matcherCompiler = NewAllocationMatchCompiler(nil)
 
 // useful for creating filters on the fly when testing. panics
 // on parse errors!
-func mustParseFilter(s string) filter21.Filter {
+func mustParseFilter(s string) filter.Filter {
 	filter, err := filterParser.Parse(s)
 	if err != nil {
 		panic(err)
@@ -3411,7 +3410,7 @@ func Test_AggregateByService_UnmountedLBs(t *testing.T) {
 	set.Insert(idle)
 
 	set.AggregateBy([]string{AllocationServiceProp}, &AllocationAggregationOptions{
-		Filter: ops.Contains(afilter.FieldServices, "nginx-plus-nginx-ingress"),
+		Filter: ops.Contains(allocation.FieldServices, "nginx-plus-nginx-ingress"),
 	})
 
 	for _, alloc := range set.Allocations {
@@ -3653,7 +3652,7 @@ func TestIsFilterEmptyTrue(t *testing.T) {
 
 func TestIsFilterEmptyFalse(t *testing.T) {
 	compiler := NewAllocationMatchCompiler(nil)
-	matcher, err := compiler.Compile(ops.Eq(afilter.FieldClusterID, "test"))
+	matcher, err := compiler.Compile(ops.Eq(allocation.FieldClusterID, "test"))
 	if err != nil {
 		t.Fatalf("compiling nil filter: %s", err)
 	}

+ 1 - 1
core/pkg/kubecost/allocationfilter_test.go → core/pkg/opencost/allocationfilter_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"testing"

+ 1 - 1
core/pkg/kubecost/allocationmatcher.go → core/pkg/opencost/allocationmatcher.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"fmt"

+ 1 - 1
core/pkg/kubecost/allocationmatcher_test.go → core/pkg/opencost/allocationmatcher_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"testing"

+ 1 - 1
core/pkg/kubecost/allocationprops.go → core/pkg/opencost/allocationprops.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"fmt"

+ 1 - 1
core/pkg/kubecost/allocationprops_test.go → core/pkg/opencost/allocationprops_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"reflect"

+ 1 - 1
core/pkg/kubecost/asset.go → core/pkg/opencost/asset.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"encoding"

+ 1 - 1
core/pkg/kubecost/asset_json.go → core/pkg/opencost/asset_json.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"bytes"

+ 1 - 1
core/pkg/kubecost/asset_json_test.go → core/pkg/opencost/asset_json_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"github.com/opencost/opencost/core/pkg/util/json"

+ 1 - 1
core/pkg/kubecost/asset_test.go → core/pkg/opencost/asset_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"encoding/json"

+ 1 - 1
core/pkg/kubecost/assetmatcher.go → core/pkg/opencost/assetmatcher.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"fmt"

+ 1 - 1
core/pkg/kubecost/assetprops.go → core/pkg/opencost/assetprops.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"fmt"

+ 2 - 2
core/pkg/kubecost/bingen.go → core/pkg/opencost/bingen.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 ////////////////////////////////////////////////////////////////////////////////
 // NOTE: If you add fields to _any_ struct that is serialized by bingen, please
@@ -71,4 +71,4 @@ package kubecost
 // @bingen:generate:CloudCostLabels
 // @bingen:end
 
-//go:generate bingen -package=kubecost -version=17 -buffer=github.com/opencost/opencost/core/pkg/util
+//go:generate bingen -package=opencost -version=17 -buffer=github.com/opencost/opencost/core/pkg/util

+ 1 - 1
core/pkg/kubecost/cloudcost.go → core/pkg/opencost/cloudcost.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"errors"

+ 1 - 1
core/pkg/kubecost/cloudcost_test.go → core/pkg/opencost/cloudcost_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"testing"

+ 1 - 1
core/pkg/kubecost/cloudcostmatcher.go → core/pkg/opencost/cloudcostmatcher.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"fmt"

+ 1 - 1
core/pkg/kubecost/cloudcostprops.go → core/pkg/opencost/cloudcostprops.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"strings"

+ 1 - 1
core/pkg/kubecost/cloudcostprops_test.go → core/pkg/opencost/cloudcostprops_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import "testing"
 

+ 1 - 1
core/pkg/kubecost/cloudusage.go → core/pkg/opencost/cloudusage.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 // CloudUsage is temporarily aliased as the Cloud Asset type until further infrastructure and pages can be built to support its usage
 type CloudUsage = Cloud

+ 1 - 1
core/pkg/kubecost/common.go → core/pkg/opencost/common.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 // Pair is a generic struct containing a pair of instances, one of each type similar to std::pair
 type Pair[T any, U any] struct {

+ 1 - 1
core/pkg/kubecost/config.go → core/pkg/opencost/config.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"fmt"

+ 1 - 1
core/pkg/kubecost/config_test.go → core/pkg/opencost/config_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"testing"

+ 1 - 1
core/pkg/kubecost/costmetric.go → core/pkg/opencost/costmetric.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"fmt"

+ 1 - 1
core/pkg/kubecost/coverage.go → core/pkg/opencost/coverage.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"time"

+ 1 - 1
core/pkg/kubecost/diff_test.go → core/pkg/opencost/diff_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"reflect"

+ 1 - 1
core/pkg/kubecost/json.go → core/pkg/opencost/json.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"bytes"

+ 1 - 1
core/pkg/kubecost/mock.go → core/pkg/opencost/mock.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"fmt"

+ 6 - 2
core/pkg/kubecost/kubecost_codecs.go → core/pkg/opencost/opencost_codecs.go

@@ -9,7 +9,7 @@
 //
 ////////////////////////////////////////////////////////////////////////////////
 
-package kubecost
+package opencost
 
 import (
 	"fmt"
@@ -23,7 +23,7 @@ import (
 
 const (
 	// GeneratorPackageName is the package the generator is targetting
-	GeneratorPackageName string = "kubecost"
+	GeneratorPackageName string = "opencost"
 )
 
 // BinaryTags represent the formatting tag used for specific optimization features
@@ -457,6 +457,7 @@ func (target *Allocation) MarshalBinaryWithContext(ctx *EncodingContext) (err er
 	}
 	// --- [end][write][alias](LbAllocations) ---
 
+	buff.WriteFloat64(target.UnmountedPVCost) // write float64
 	return nil
 }
 
@@ -769,6 +770,9 @@ func (target *Allocation) UnmarshalBinaryWithContext(ctx *DecodingContext) (err
 	} else {
 	}
 
+	fff := buff.ReadFloat64() // read float64
+	target.UnmountedPVCost = fff
+
 	return nil
 }
 

+ 1 - 1
core/pkg/kubecost/kubecost_codecs_test.go → core/pkg/opencost/opencost_codecs_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"testing"

+ 1 - 1
core/pkg/kubecost/query.go → core/pkg/opencost/query.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"strings"

+ 1 - 1
core/pkg/kubecost/status.go → core/pkg/opencost/status.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import "time"
 

+ 1 - 1
core/pkg/kubecost/summaryallocation.go → core/pkg/opencost/summaryallocation.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"errors"

+ 1 - 1
core/pkg/kubecost/summaryallocation_json.go → core/pkg/opencost/summaryallocation_json.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"time"

+ 1 - 1
core/pkg/kubecost/summaryallocation_json_test.go → core/pkg/opencost/summaryallocation_json_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"encoding/json"

+ 1 - 1
core/pkg/kubecost/summaryallocation_test.go → core/pkg/opencost/summaryallocation_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"testing"

+ 1 - 1
core/pkg/kubecost/totals.go → core/pkg/opencost/totals.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"errors"

+ 1 - 1
core/pkg/kubecost/totals_json.go → core/pkg/opencost/totals_json.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"time"

+ 1 - 1
core/pkg/kubecost/totals_test.go → core/pkg/opencost/totals_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"math"

+ 1 - 1
core/pkg/kubecost/window.go → core/pkg/opencost/window.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"bytes"

+ 1 - 1
core/pkg/kubecost/window_test.go → core/pkg/opencost/window_test.go

@@ -1,4 +1,4 @@
-package kubecost
+package opencost
 
 import (
 	"encoding/json"

+ 170 - 170
core/pkg/util/filterutil/asset_test.go

@@ -4,50 +4,50 @@ import (
 	"testing"
 
 	"github.com/opencost/opencost/core/pkg/clusters"
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/mapper"
 )
 
-var assetCompiler = kubecost.NewAssetMatchCompiler()
+var assetCompiler = opencost.NewAssetMatchCompiler()
 
 func TestAssetFiltersFromParamsV1(t *testing.T) {
 	cases := []struct {
 		name           string
 		qp             map[string]string
-		shouldMatch    []kubecost.Asset
-		shouldNotMatch []kubecost.Asset
+		shouldMatch    []opencost.Asset
+		shouldNotMatch []opencost.Asset
 	}{
 		{
 			name: "empty",
 			qp:   map[string]string{},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Node{},
-				&kubecost.Any{},
-				&kubecost.Cloud{},
-				&kubecost.LoadBalancer{},
-				&kubecost.ClusterManagement{},
-				&kubecost.Disk{},
-				&kubecost.Network{},
-				&kubecost.SharedAsset{},
-			},
-			shouldNotMatch: []kubecost.Asset{},
+			shouldMatch: []opencost.Asset{
+				&opencost.Node{},
+				&opencost.Any{},
+				&opencost.Cloud{},
+				&opencost.LoadBalancer{},
+				&opencost.ClusterManagement{},
+				&opencost.Disk{},
+				&opencost.Network{},
+				&opencost.SharedAsset{},
+			},
+			shouldNotMatch: []opencost.Asset{},
 		},
 		{
 			name: "type: node",
 			qp: map[string]string{
 				ParamFilterTypes: "node",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Node{},
+			shouldMatch: []opencost.Asset{
+				&opencost.Node{},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.Any{},
-				&kubecost.Cloud{},
-				&kubecost.LoadBalancer{},
-				&kubecost.ClusterManagement{},
-				&kubecost.Disk{},
-				&kubecost.Network{},
-				&kubecost.SharedAsset{},
+			shouldNotMatch: []opencost.Asset{
+				&opencost.Any{},
+				&opencost.Cloud{},
+				&opencost.LoadBalancer{},
+				&opencost.ClusterManagement{},
+				&opencost.Disk{},
+				&opencost.Network{},
+				&opencost.SharedAsset{},
 			},
 		},
 		{
@@ -55,17 +55,17 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterTypes: "Node",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Node{},
+			shouldMatch: []opencost.Asset{
+				&opencost.Node{},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.Any{},
-				&kubecost.Cloud{},
-				&kubecost.LoadBalancer{},
-				&kubecost.ClusterManagement{},
-				&kubecost.Disk{},
-				&kubecost.Network{},
-				&kubecost.SharedAsset{},
+			shouldNotMatch: []opencost.Asset{
+				&opencost.Any{},
+				&opencost.Cloud{},
+				&opencost.LoadBalancer{},
+				&opencost.ClusterManagement{},
+				&opencost.Disk{},
+				&opencost.Network{},
+				&opencost.SharedAsset{},
 			},
 		},
 		{
@@ -73,17 +73,17 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterTypes: "disk",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Disk{},
+			shouldMatch: []opencost.Asset{
+				&opencost.Disk{},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.Any{},
-				&kubecost.Cloud{},
-				&kubecost.Network{},
-				&kubecost.Node{},
-				&kubecost.LoadBalancer{},
-				&kubecost.ClusterManagement{},
-				&kubecost.SharedAsset{},
+			shouldNotMatch: []opencost.Asset{
+				&opencost.Any{},
+				&opencost.Cloud{},
+				&opencost.Network{},
+				&opencost.Node{},
+				&opencost.LoadBalancer{},
+				&opencost.ClusterManagement{},
+				&opencost.SharedAsset{},
 			},
 		},
 		{
@@ -91,17 +91,17 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterTypes: "loadbalancer",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.LoadBalancer{},
+			shouldMatch: []opencost.Asset{
+				&opencost.LoadBalancer{},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.Any{},
-				&kubecost.Cloud{},
-				&kubecost.Node{},
-				&kubecost.ClusterManagement{},
-				&kubecost.Disk{},
-				&kubecost.Network{},
-				&kubecost.SharedAsset{},
+			shouldNotMatch: []opencost.Asset{
+				&opencost.Any{},
+				&opencost.Cloud{},
+				&opencost.Node{},
+				&opencost.ClusterManagement{},
+				&opencost.Disk{},
+				&opencost.Network{},
+				&opencost.SharedAsset{},
 			},
 		},
 		{
@@ -109,17 +109,17 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterTypes: "clustermanagement",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.ClusterManagement{},
+			shouldMatch: []opencost.Asset{
+				&opencost.ClusterManagement{},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.Any{},
-				&kubecost.Cloud{},
-				&kubecost.LoadBalancer{},
-				&kubecost.Node{},
-				&kubecost.Disk{},
-				&kubecost.Network{},
-				&kubecost.SharedAsset{},
+			shouldNotMatch: []opencost.Asset{
+				&opencost.Any{},
+				&opencost.Cloud{},
+				&opencost.LoadBalancer{},
+				&opencost.Node{},
+				&opencost.Disk{},
+				&opencost.Network{},
+				&opencost.SharedAsset{},
 			},
 		},
 		{
@@ -127,17 +127,17 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterTypes: "network",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Network{},
+			shouldMatch: []opencost.Asset{
+				&opencost.Network{},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.Any{},
-				&kubecost.Cloud{},
-				&kubecost.LoadBalancer{},
-				&kubecost.ClusterManagement{},
-				&kubecost.Node{},
-				&kubecost.Disk{},
-				&kubecost.SharedAsset{},
+			shouldNotMatch: []opencost.Asset{
+				&opencost.Any{},
+				&opencost.Cloud{},
+				&opencost.LoadBalancer{},
+				&opencost.ClusterManagement{},
+				&opencost.Node{},
+				&opencost.Disk{},
+				&opencost.SharedAsset{},
 			},
 		},
 		{
@@ -145,21 +145,21 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterAccounts: "foo,bar",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Node{
-					Properties: &kubecost.AssetProperties{
+			shouldMatch: []opencost.Asset{
+				&opencost.Node{
+					Properties: &opencost.AssetProperties{
 						Account: "foo",
 					},
 				},
-				&kubecost.Network{
-					Properties: &kubecost.AssetProperties{
+				&opencost.Network{
+					Properties: &opencost.AssetProperties{
 						Account: "bar",
 					},
 				},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.Network{
-					Properties: &kubecost.AssetProperties{
+			shouldNotMatch: []opencost.Asset{
+				&opencost.Network{
+					Properties: &opencost.AssetProperties{
 						Account: "baz",
 					},
 				},
@@ -170,22 +170,22 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterCategories: "Network,Compute",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Network{
-					Properties: &kubecost.AssetProperties{
-						Category: kubecost.NetworkCategory,
+			shouldMatch: []opencost.Asset{
+				&opencost.Network{
+					Properties: &opencost.AssetProperties{
+						Category: opencost.NetworkCategory,
 					},
 				},
-				&kubecost.Node{
-					Properties: &kubecost.AssetProperties{
-						Category: kubecost.ComputeCategory,
+				&opencost.Node{
+					Properties: &opencost.AssetProperties{
+						Category: opencost.ComputeCategory,
 					},
 				},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.ClusterManagement{
-					Properties: &kubecost.AssetProperties{
-						Category: kubecost.ManagementCategory,
+			shouldNotMatch: []opencost.Asset{
+				&opencost.ClusterManagement{
+					Properties: &opencost.AssetProperties{
+						Category: opencost.ManagementCategory,
 					},
 				},
 			},
@@ -195,21 +195,21 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterClusters: "cluster-one",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.LoadBalancer{
-					Properties: &kubecost.AssetProperties{
+			shouldMatch: []opencost.Asset{
+				&opencost.LoadBalancer{
+					Properties: &opencost.AssetProperties{
 						Cluster: "cluster-one",
 					},
 				},
-				&kubecost.Node{
-					Properties: &kubecost.AssetProperties{
+				&opencost.Node{
+					Properties: &opencost.AssetProperties{
 						Cluster: "cluster-one",
 					},
 				},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.ClusterManagement{
-					Properties: &kubecost.AssetProperties{
+			shouldNotMatch: []opencost.Asset{
+				&opencost.ClusterManagement{
+					Properties: &opencost.AssetProperties{
 						Cluster: "cluster-two",
 					},
 				},
@@ -220,21 +220,21 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterProjects: "proj1,proj2",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Disk{
-					Properties: &kubecost.AssetProperties{
+			shouldMatch: []opencost.Asset{
+				&opencost.Disk{
+					Properties: &opencost.AssetProperties{
 						Project: "proj1",
 					},
 				},
-				&kubecost.Node{
-					Properties: &kubecost.AssetProperties{
+				&opencost.Node{
+					Properties: &opencost.AssetProperties{
 						Project: "proj2",
 					},
 				},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.ClusterManagement{
-					Properties: &kubecost.AssetProperties{
+			shouldNotMatch: []opencost.Asset{
+				&opencost.ClusterManagement{
+					Properties: &opencost.AssetProperties{
 						Project: "proj3",
 					},
 				},
@@ -245,21 +245,21 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterProviders: "p1,p2",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Disk{
-					Properties: &kubecost.AssetProperties{
+			shouldMatch: []opencost.Asset{
+				&opencost.Disk{
+					Properties: &opencost.AssetProperties{
 						Provider: "p1",
 					},
 				},
-				&kubecost.Network{
-					Properties: &kubecost.AssetProperties{
+				&opencost.Network{
+					Properties: &opencost.AssetProperties{
 						Provider: "p2",
 					},
 				},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.Node{
-					Properties: &kubecost.AssetProperties{
+			shouldNotMatch: []opencost.Asset{
+				&opencost.Node{
+					Properties: &opencost.AssetProperties{
 						Provider: "p3",
 					},
 				},
@@ -270,21 +270,21 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterProviderIDs: "p1,p2",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Disk{
-					Properties: &kubecost.AssetProperties{
+			shouldMatch: []opencost.Asset{
+				&opencost.Disk{
+					Properties: &opencost.AssetProperties{
 						ProviderID: "p1",
 					},
 				},
-				&kubecost.Network{
-					Properties: &kubecost.AssetProperties{
+				&opencost.Network{
+					Properties: &opencost.AssetProperties{
 						ProviderID: "p2",
 					},
 				},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.Node{
-					Properties: &kubecost.AssetProperties{
+			shouldNotMatch: []opencost.Asset{
+				&opencost.Node{
+					Properties: &opencost.AssetProperties{
 						ProviderID: "p3",
 					},
 				},
@@ -295,21 +295,21 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterProviderIDsV2: "p1,p2",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Disk{
-					Properties: &kubecost.AssetProperties{
+			shouldMatch: []opencost.Asset{
+				&opencost.Disk{
+					Properties: &opencost.AssetProperties{
 						ProviderID: "p1",
 					},
 				},
-				&kubecost.Network{
-					Properties: &kubecost.AssetProperties{
+				&opencost.Network{
+					Properties: &opencost.AssetProperties{
 						ProviderID: "p2",
 					},
 				},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.Node{
-					Properties: &kubecost.AssetProperties{
+			shouldNotMatch: []opencost.Asset{
+				&opencost.Node{
+					Properties: &opencost.AssetProperties{
 						ProviderID: "p3",
 					},
 				},
@@ -320,21 +320,21 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterServices: "p1,p2",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Disk{
-					Properties: &kubecost.AssetProperties{
+			shouldMatch: []opencost.Asset{
+				&opencost.Disk{
+					Properties: &opencost.AssetProperties{
 						Service: "p1",
 					},
 				},
-				&kubecost.Network{
-					Properties: &kubecost.AssetProperties{
+				&opencost.Network{
+					Properties: &opencost.AssetProperties{
 						Service: "p2",
 					},
 				},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.Node{
-					Properties: &kubecost.AssetProperties{
+			shouldNotMatch: []opencost.Asset{
+				&opencost.Node{
+					Properties: &opencost.AssetProperties{
 						Service: "p3",
 					},
 				},
@@ -345,22 +345,22 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterLabels: "foo:bar,baz:qux",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Disk{
-					Labels: kubecost.AssetLabels{
+			shouldMatch: []opencost.Asset{
+				&opencost.Disk{
+					Labels: opencost.AssetLabels{
 						"foo": "bar",
 						"baz": "other",
 					},
 				},
-				&kubecost.Node{
-					Labels: kubecost.AssetLabels{
+				&opencost.Node{
+					Labels: opencost.AssetLabels{
 						"baz": "qux",
 					},
 				},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.ClusterManagement{
-					Labels: kubecost.AssetLabels{
+			shouldNotMatch: []opencost.Asset{
+				&opencost.ClusterManagement{
+					Labels: opencost.AssetLabels{
 						"baz": "other",
 					},
 				},
@@ -371,21 +371,21 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				ParamFilterRegions: "r1,r2",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Node{
-					Labels: kubecost.AssetLabels{
+			shouldMatch: []opencost.Asset{
+				&opencost.Node{
+					Labels: opencost.AssetLabels{
 						"label_topology_kubernetes_io_region": "r1",
 					},
 				},
-				&kubecost.Node{
-					Labels: kubecost.AssetLabels{
+				&opencost.Node{
+					Labels: opencost.AssetLabels{
 						"label_topology_kubernetes_io_region": "r2",
 					},
 				},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.Node{
-					Labels: kubecost.AssetLabels{
+			shouldNotMatch: []opencost.Asset{
+				&opencost.Node{
+					Labels: opencost.AssetLabels{
 						"label_topology_kubernetes_io_region": "r3",
 					},
 				},
@@ -398,32 +398,32 @@ func TestAssetFiltersFromParamsV1(t *testing.T) {
 				ParamFilterTypes:    "node",
 				ParamFilterAccounts: "a*",
 			},
-			shouldMatch: []kubecost.Asset{
-				&kubecost.Node{
-					Labels: kubecost.AssetLabels{
+			shouldMatch: []opencost.Asset{
+				&opencost.Node{
+					Labels: opencost.AssetLabels{
 						"label_topology_kubernetes_io_region": "r1",
 					},
-					Properties: &kubecost.AssetProperties{
+					Properties: &opencost.AssetProperties{
 						Account: "a1",
 					},
 				},
-				&kubecost.Node{
-					Labels: kubecost.AssetLabels{
+				&opencost.Node{
+					Labels: opencost.AssetLabels{
 						"label_topology_kubernetes_io_region": "r2",
 					},
-					Properties: &kubecost.AssetProperties{
+					Properties: &opencost.AssetProperties{
 						Account: "a2",
 					},
 				},
 			},
-			shouldNotMatch: []kubecost.Asset{
-				&kubecost.Node{
-					Properties: &kubecost.AssetProperties{
+			shouldNotMatch: []opencost.Asset{
+				&opencost.Node{
+					Properties: &opencost.AssetProperties{
 						Account: "b1",
 					},
 				},
-				&kubecost.Node{
-					Properties: &kubecost.AssetProperties{
+				&opencost.Node{
+					Properties: &opencost.AssetProperties{
 						Account: "3a",
 					},
 				},

+ 25 - 25
core/pkg/util/filterutil/filterparams.go

@@ -3,8 +3,8 @@ package filterutil
 import (
 	"reflect"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/mapper"
 )
 
@@ -63,35 +63,35 @@ func ValidAssetFilterParams() []string {
 // representations to v1 filter param keys for legacy filter config support
 // (e.g. reports). Example mapping: "cluster" -> "filterClusters"
 var AllocationPropToV1FilterParamKey = map[string]string{
-	kubecost.AllocationClusterProp:        ParamFilterClusters,
-	kubecost.AllocationNodeProp:           ParamFilterNodes,
-	kubecost.AllocationNamespaceProp:      ParamFilterNamespaces,
-	kubecost.AllocationControllerProp:     ParamFilterControllers,
-	kubecost.AllocationControllerKindProp: ParamFilterControllerKinds,
-	kubecost.AllocationPodProp:            ParamFilterPods,
-	kubecost.AllocationLabelProp:          ParamFilterLabels,
-	kubecost.AllocationServiceProp:        ParamFilterServices,
-	kubecost.AllocationDepartmentProp:     ParamFilterDepartments,
-	kubecost.AllocationEnvironmentProp:    ParamFilterEnvironments,
-	kubecost.AllocationOwnerProp:          ParamFilterOwners,
-	kubecost.AllocationProductProp:        ParamFilterProducts,
-	kubecost.AllocationTeamProp:           ParamFilterTeams,
+	opencost.AllocationClusterProp:        ParamFilterClusters,
+	opencost.AllocationNodeProp:           ParamFilterNodes,
+	opencost.AllocationNamespaceProp:      ParamFilterNamespaces,
+	opencost.AllocationControllerProp:     ParamFilterControllers,
+	opencost.AllocationControllerKindProp: ParamFilterControllerKinds,
+	opencost.AllocationPodProp:            ParamFilterPods,
+	opencost.AllocationLabelProp:          ParamFilterLabels,
+	opencost.AllocationServiceProp:        ParamFilterServices,
+	opencost.AllocationDepartmentProp:     ParamFilterDepartments,
+	opencost.AllocationEnvironmentProp:    ParamFilterEnvironments,
+	opencost.AllocationOwnerProp:          ParamFilterOwners,
+	opencost.AllocationProductProp:        ParamFilterProducts,
+	opencost.AllocationTeamProp:           ParamFilterTeams,
 }
 
 // Map to store Kubecost Asset property to Asset Filter types.
 // AssetPropToV1FilterParamKey maps asset string property representations to v1
 // filter param keys for legacy filter config support (e.g. reports). Example
 // mapping: "category" -> "filterCategories"
-var AssetPropToV1FilterParamKey = map[kubecost.AssetProperty]string{
-	kubecost.AssetNameProp:       ParamFilterNames,
-	kubecost.AssetTypeProp:       ParamFilterTypes,
-	kubecost.AssetAccountProp:    ParamFilterAccounts,
-	kubecost.AssetCategoryProp:   ParamFilterCategories,
-	kubecost.AssetClusterProp:    ParamFilterClusters,
-	kubecost.AssetProjectProp:    ParamFilterProjects,
-	kubecost.AssetProviderProp:   ParamFilterProviders,
-	kubecost.AssetProviderIDProp: ParamFilterProviderIDs,
-	kubecost.AssetServiceProp:    ParamFilterServices,
+var AssetPropToV1FilterParamKey = map[opencost.AssetProperty]string{
+	opencost.AssetNameProp:       ParamFilterNames,
+	opencost.AssetTypeProp:       ParamFilterTypes,
+	opencost.AssetAccountProp:    ParamFilterAccounts,
+	opencost.AssetCategoryProp:   ParamFilterCategories,
+	opencost.AssetClusterProp:    ParamFilterClusters,
+	opencost.AssetProjectProp:    ParamFilterProjects,
+	opencost.AssetProviderProp:   ParamFilterProviders,
+	opencost.AssetProviderIDProp: ParamFilterProviderIDs,
+	opencost.AssetServiceProp:    ParamFilterServices,
 }
 
 // AllHTTPParamKeys returns all HTTP GET parameters used for v1 filters. It is
@@ -119,7 +119,7 @@ func AllHTTPParamKeys() []string {
 	}
 }
 
-func ConvertFilterQueryParams(qp mapper.PrimitiveMapReader, labelConfig *kubecost.LabelConfig) AllocationFilterV1 {
+func ConvertFilterQueryParams(qp mapper.PrimitiveMapReader, labelConfig *opencost.LabelConfig) AllocationFilterV1 {
 	filter := AllocationFilterV1{
 		Annotations:     qp.GetList(ParamFilterAnnotations, ","),
 		Containers:      qp.GetList(ParamFilterContainers, ","),

+ 2 - 2
core/pkg/util/filterutil/filterutil.go

@@ -4,8 +4,8 @@ import (
 	"strings"
 
 	"github.com/opencost/opencost/core/pkg/clusters"
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/mapper"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
 	"github.com/opencost/opencost/core/pkg/util/typeutil"
@@ -66,7 +66,7 @@ func DefaultFieldByName[T ~string](field T) *ast.Field {
 // of `clusterID = "foo" OR clusterName = "foo"`.
 func AllocationFilterFromParamsV1(
 	params AllocationFilterV1,
-	labelConfig *kubecost.LabelConfig,
+	labelConfig *opencost.LabelConfig,
 	clusterMap clusters.ClusterMap,
 ) filter.Filter {
 

+ 166 - 166
core/pkg/util/filterutil/queryfilters_test.go

@@ -4,11 +4,11 @@ import (
 	"testing"
 
 	"github.com/opencost/opencost/core/pkg/clusters"
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/mapper"
 )
 
-var allocCompiler = kubecost.NewAllocationMatchCompiler(nil)
+var allocCompiler = opencost.NewAllocationMatchCompiler(nil)
 
 type mockClusterMap struct {
 	m map[string]*clusters.ClusterInfo
@@ -38,8 +38,8 @@ func (mcp mockClusterMap) SplitNameID(nameID string) (string, string) {
 
 func (mcp mockClusterMap) StopRefresh() {}
 
-func allocGenerator(props kubecost.AllocationProperties) kubecost.Allocation {
-	a := kubecost.Allocation{
+func allocGenerator(props opencost.AllocationProperties) opencost.Allocation {
+	a := opencost.Allocation{
 		Properties: &props,
 	}
 
@@ -52,21 +52,21 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 	cases := []struct {
 		name           string
 		qp             map[string]string
-		shouldMatch    []kubecost.Allocation
-		shouldNotMatch []kubecost.Allocation
+		shouldMatch    []opencost.Allocation
+		shouldNotMatch []opencost.Allocation
 	}{
 		{
 			name: "single cluster ID",
 			qp: map[string]string{
 				"filterClusters": "cluster-one",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Cluster: "cluster-one",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Cluster: "foo",
 				}),
 			},
@@ -76,22 +76,22 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterClusters": "cluster*",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Cluster: "cluster-one",
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Cluster: "cluster-two",
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Cluster: "cluster",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Cluster: "foo",
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Cluster: "cluste",
 				}),
 			},
@@ -101,13 +101,13 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterClusters": "cluster ABC",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Cluster: "mapped-cluster-ID-ABC",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Cluster: "cluster-one",
 				}),
 			},
@@ -117,13 +117,13 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterClusters": "cluster A*",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Cluster: "mapped-cluster-ID-ABC",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Cluster: "cluster-one",
 				}),
 			},
@@ -133,13 +133,13 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterNodes": "node-123-abc",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Node: "node-123-abc",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Node: "node-456-def",
 				}),
 			},
@@ -149,13 +149,13 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterNodes": "node-1*",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Node: "node-123-abc",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Node: "node-456-def",
 				}),
 			},
@@ -165,13 +165,13 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterNamespaces": "kubecost",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Namespace: "kubecost",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Namespace: "kubecost2",
 				}),
 			},
@@ -181,16 +181,16 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterNamespaces": "kube*",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Namespace: "kubecost",
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Namespace: "kube-system",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Namespace: "kub",
 				}),
 			},
@@ -200,13 +200,13 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterControllerKinds": "deployment",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					ControllerKind: "deployment",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					ControllerKind: "daemonset",
 				}),
 			},
@@ -216,13 +216,13 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterControllerKinds": "depl*",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					ControllerKind: "deployment",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					ControllerKind: "daemonset",
 				}),
 			},
@@ -232,13 +232,13 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterControllers": "kubecost-cost-analyzer",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Controller: "kubecost-cost-analyzer",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Controller: "kube-proxy",
 				}),
 			},
@@ -248,16 +248,16 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterControllers": "kubecost-*",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Controller: "kubecost-cost-analyzer",
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Controller: "kubecost-frontend",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Controller: "kube-proxy",
 				}),
 			},
@@ -267,14 +267,14 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterControllers": "deployment:kubecost-cost-analyzer",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					ControllerKind: "deployment",
 					Controller:     "kubecost-cost-analyzer",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					ControllerKind: "daemonset",
 					Controller:     "kubecost-cost-analyzer",
 				}),
@@ -285,18 +285,18 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterControllers": "deployment:kubecost*",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					ControllerKind: "deployment",
 					Controller:     "kubecost-cost-analyzer",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					ControllerKind: "daemonset",
 					Controller:     "kubecost-cost-analyzer",
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					ControllerKind: "deployment",
 					Controller:     "kube-system",
 				}),
@@ -307,13 +307,13 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterPods": "pod-123-abc",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Pod: "pod-123-abc",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Pod: "pod-456-def",
 				}),
 			},
@@ -323,13 +323,13 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterPods": "pod-1*",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Pod: "pod-123-abc",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Pod: "pod-456-def",
 				}),
 			},
@@ -339,13 +339,13 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterContainers": "container-123-abc",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Container: "container-123-abc",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Container: "container-456-def",
 				}),
 			},
@@ -355,13 +355,13 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterContainers": "container-1*",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Container: "container-123-abc",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Container: "container-456-def",
 				}),
 			},
@@ -371,15 +371,15 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterDepartments": "pa-1",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Labels: map[string]string{
 						"internal_product_umbrella": "pa-1",
 					},
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Labels: map[string]string{
 						"internal_product_umbrella": "ps-N",
 					},
@@ -391,16 +391,16 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterDepartments": "pa-1",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Annotations: map[string]string{
 						"internal_product_umbrella": "pa-1",
 					},
 				}),
 			},
 			// should find labels first and fail
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Labels: map[string]string{
 						"internal_product_umbrella": "ps-N",
 					},
@@ -415,15 +415,15 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterDepartments": "pa*",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Labels: map[string]string{
 						"internal_product_umbrella": "pa-1",
 					},
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Labels: map[string]string{
 						"internal_product_umbrella": "ps-N",
 					},
@@ -435,20 +435,20 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterLabels": "app-a:cost-analyzer",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Labels: map[string]string{
 						"app_a": "cost-analyzer",
 					},
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Labels: map[string]string{
 						"app_a": "foo",
 					},
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Labels: map[string]string{
 						"foo": "bar",
 					},
@@ -460,20 +460,20 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterLabels": "app:cost-*",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Labels: map[string]string{
 						"app": "cost-analyzer",
 					},
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Labels: map[string]string{
 						"app": "foo",
 					},
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Labels: map[string]string{
 						"foo": "bar",
 					},
@@ -485,20 +485,20 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterAnnotations": "app:cost-analyzer",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Annotations: map[string]string{
 						"app": "cost-analyzer",
 					},
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Annotations: map[string]string{
 						"app": "foo",
 					},
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Annotations: map[string]string{
 						"foo": "bar",
 					},
@@ -510,20 +510,20 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterAnnotations": "app:cost-*",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Annotations: map[string]string{
 						"app": "cost-analyzer",
 					},
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Annotations: map[string]string{
 						"app": "foo",
 					},
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Annotations: map[string]string{
 						"foo": "bar",
 					},
@@ -535,14 +535,14 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterServices": "serv1",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Services: []string{"serv1"},
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{}),
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{}),
+				allocGenerator(opencost.AllocationProperties{
 					Services: []string{"serv2"},
 				}),
 			},
@@ -552,17 +552,17 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterServices": "serv1,serv3",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Services: []string{"serv1"},
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Services: []string{"serv2", "serv3"},
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{}),
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{}),
+				allocGenerator(opencost.AllocationProperties{
 					Services: []string{"serv2"},
 				}),
 			},
@@ -572,17 +572,17 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterServices": "serv*",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Services: []string{"serv1"},
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Services: []string{"serv2"},
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{}),
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{}),
+				allocGenerator(opencost.AllocationProperties{
 					Services: []string{"foo"},
 				}),
 			},
@@ -593,42 +593,42 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 				"filterNamespaces": "kube-system,kubecost",
 				"filterLabels":     "app:cost-analyzer,app:kube-proxy,foo:bar",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Namespace: "kubecost",
 					Labels: map[string]string{
 						"app": "cost-analyzer",
 					},
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Namespace: "kubecost",
 					Labels: map[string]string{
 						"foo": "bar",
 					},
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Namespace: "kube-system",
 					Labels: map[string]string{
 						"app": "kube-proxy",
 					},
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Namespace: "kubecost",
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Namespace: "kubecost",
 					Labels: map[string]string{
 						"app": "something",
 					},
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Labels: map[string]string{
 						"app": "foo",
 					},
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Labels: map[string]string{
 						"foo": "bar",
 					},
@@ -640,16 +640,16 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterClusters": "cluster ABC,cluster-one",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Cluster: "mapped-cluster-ID-ABC",
 				}),
-				allocGenerator(kubecost.AllocationProperties{
+				allocGenerator(opencost.AllocationProperties{
 					Cluster: "cluster-one",
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
 					Cluster: "cluster",
 				}),
 			},
@@ -659,48 +659,48 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			qp: map[string]string{
 				"filterOwners": "nick",
 			},
-			shouldMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
-					Labels: kubecost.AllocationLabels{
+			shouldMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
+					Labels: opencost.AllocationLabels{
 						"testowner": "nick",
 					},
 				}),
-				allocGenerator(kubecost.AllocationProperties{
-					Annotations: kubecost.AllocationAnnotations{
+				allocGenerator(opencost.AllocationProperties{
+					Annotations: opencost.AllocationAnnotations{
 						"testowner": "nick",
 					},
 				}),
-				allocGenerator(kubecost.AllocationProperties{
-					Labels: kubecost.AllocationLabels{
+				allocGenerator(opencost.AllocationProperties{
+					Labels: opencost.AllocationLabels{
 						"testowner": "nick",
 					},
-					Annotations: kubecost.AllocationAnnotations{
+					Annotations: opencost.AllocationAnnotations{
 						"dontpick": "notnick",
 					},
 				}),
-				allocGenerator(kubecost.AllocationProperties{
-					Labels: kubecost.AllocationLabels{
+				allocGenerator(opencost.AllocationProperties{
+					Labels: opencost.AllocationLabels{
 						"dontpick": "notnick",
 					},
-					Annotations: kubecost.AllocationAnnotations{
+					Annotations: opencost.AllocationAnnotations{
 						"testowner": "nick",
 					},
 				}),
 			},
-			shouldNotMatch: []kubecost.Allocation{
-				allocGenerator(kubecost.AllocationProperties{
-					Labels: kubecost.AllocationLabels{
+			shouldNotMatch: []opencost.Allocation{
+				allocGenerator(opencost.AllocationProperties{
+					Labels: opencost.AllocationLabels{
 						"dontpick": "notnick",
 					},
-					Annotations: kubecost.AllocationAnnotations{
+					Annotations: opencost.AllocationAnnotations{
 						"dontpick": "notnick",
 					},
 				}),
-				allocGenerator(kubecost.AllocationProperties{
-					Labels: kubecost.AllocationLabels{
+				allocGenerator(opencost.AllocationProperties{
+					Labels: opencost.AllocationLabels{
 						"testowner": "notnick",
 					},
-					Annotations: kubecost.AllocationAnnotations{
+					Annotations: opencost.AllocationAnnotations{
 						"testowner": "nick",
 					},
 				}),
@@ -718,7 +718,7 @@ func TestAllocationFiltersFromParamsV1(t *testing.T) {
 			}
 			qpMapper := mapper.NewMapper(qpMap)
 
-			labelConfig := kubecost.LabelConfig{}
+			labelConfig := opencost.LabelConfig{}
 			labelConfig.DepartmentLabel = "internal-product-umbrella"
 			labelConfig.OwnerLabel = "testowner"
 

+ 2 - 2
pkg/cloud/alibaba/boaconfiguration.go

@@ -3,7 +3,7 @@ package alibaba
 import (
 	"fmt"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/json"
 	"github.com/opencost/opencost/pkg/cloud"
 )
@@ -79,7 +79,7 @@ func (bc *BOAConfiguration) Key() string {
 }
 
 func (bc *BOAConfiguration) Provider() string {
-	return kubecost.AlibabaProvider
+	return opencost.AlibabaProvider
 }
 
 func (bc *BOAConfiguration) UnmarshalJSON(b []byte) error {

+ 9 - 9
pkg/cloud/alibaba/boaquerier.go

@@ -6,8 +6,8 @@ import (
 
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
 	"github.com/aliyun/alibaba-cloud-sdk-go/services/bssopenapi"
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/pkg/cloud"
 )
 
@@ -106,15 +106,15 @@ func SelectAlibabaCategory(item bssopenapi.Item) string {
 	if (item != bssopenapi.Item{}) {
 		// Provider ID has prefix "i-" for node in Alibaba
 		if strings.HasPrefix(item.InstanceID, boaIsNode) {
-			return kubecost.ComputeCategory
+			return opencost.ComputeCategory
 		}
 		// Provider ID for disk start with "d-" for storage type in Alibaba
 		if strings.HasPrefix(item.InstanceID, boaIsDisk) {
-			return kubecost.StorageCategory
+			return opencost.StorageCategory
 		}
 		// Network has the highest priority and is based on the usage type of "piece" in Alibaba
 		if item.UsageUnit == boaIsNetwork {
-			return kubecost.NetworkCategory
+			return opencost.NetworkCategory
 		}
 	}
 
@@ -122,14 +122,14 @@ func SelectAlibabaCategory(item bssopenapi.Item) string {
 	// TO-DO: Can investigate further product codes but bare minimal differentiation for start
 	switch strings.ToLower(item.ProductCode) {
 	case "slb", "eip", "nis", "gtm":
-		return kubecost.NetworkCategory
+		return opencost.NetworkCategory
 	case "ecs", "eds", "sas":
-		return kubecost.ComputeCategory
+		return opencost.ComputeCategory
 	case "ack":
-		return kubecost.ManagementCategory
+		return opencost.ManagementCategory
 	case "ebs", "oss", "scu":
-		return kubecost.StorageCategory
+		return opencost.StorageCategory
 	default:
-		return kubecost.OtherCategory
+		return opencost.OtherCategory
 	}
 }

+ 2 - 2
pkg/cloud/alibaba/provider.go

@@ -16,8 +16,8 @@ import (
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
 	"github.com/opencost/opencost/core/pkg/env"
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/fileutil"
 	"github.com/opencost/opencost/core/pkg/util/json"
 	"github.com/opencost/opencost/core/pkg/util/stringutil"
@@ -696,7 +696,7 @@ func (alibaba *Alibaba) ClusterInfo() (map[string]string, error) {
 
 	m := make(map[string]string)
 	m["name"] = clusterName
-	m["provider"] = kubecost.AlibabaProvider
+	m["provider"] = opencost.AlibabaProvider
 	m["project"] = alibaba.ClusterAccountId
 	m["region"] = alibaba.ClusterRegion
 	m["id"] = ocenv.GetClusterID()

+ 2 - 2
pkg/cloud/aws/athenaconfiguration.go

@@ -3,7 +3,7 @@ package aws
 import (
 	"fmt"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/json"
 	"github.com/opencost/opencost/pkg/cloud"
 )
@@ -124,7 +124,7 @@ func (ac *AthenaConfiguration) Key() string {
 }
 
 func (ac *AthenaConfiguration) Provider() string {
-	return kubecost.AWSProvider
+	return opencost.AWSProvider
 }
 
 func (ac *AthenaConfiguration) UnmarshalJSON(b []byte) error {

+ 16 - 16
pkg/cloud/aws/athenaintegration.go

@@ -8,8 +8,8 @@ import (
 	"time"
 
 	"github.com/aws/aws-sdk-go-v2/service/athena/types"
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/pkg/cloud"
 )
 
@@ -64,8 +64,8 @@ type AthenaIntegration struct {
 }
 
 // Query Athena for CUR data and build a new CloudCostSetRange containing the info
-func (ai *AthenaIntegration) GetCloudCost(start, end time.Time) (*kubecost.CloudCostSetRange, error) {
-	log.Infof("AthenaIntegration[%s]: GetCloudCost: %s", ai.Key(), kubecost.NewWindow(&start, &end).String())
+func (ai *AthenaIntegration) GetCloudCost(start, end time.Time) (*opencost.CloudCostSetRange, error) {
+	log.Infof("AthenaIntegration[%s]: GetCloudCost: %s", ai.Key(), opencost.NewWindow(&start, &end).String())
 	// Query for all column names
 	allColumns, err := ai.GetColumns()
 	if err != nil {
@@ -153,7 +153,7 @@ func (ai *AthenaIntegration) GetCloudCost(start, end time.Time) (*kubecost.Cloud
 	`
 	aqi.Query = fmt.Sprintf(queryStr, columnStr, ai.Table, whereClause, groupByStr)
 
-	ccsr, err := kubecost.NewCloudCostSetRange(start, end, kubecost.AccumulateOptionDay, ai.Key())
+	ccsr, err := opencost.NewCloudCostSetRange(start, end, opencost.AccumulateOptionDay, ai.Key())
 	if err != nil {
 		return nil, err
 	}
@@ -324,14 +324,14 @@ func (ai *AthenaIntegration) GetPartitionWhere(start, end time.Time) string {
 	return str
 }
 
-func (ai *AthenaIntegration) RowToCloudCost(row types.Row, aqi AthenaQueryIndexes, ccsr *kubecost.CloudCostSetRange) error {
+func (ai *AthenaIntegration) RowToCloudCost(row types.Row, aqi AthenaQueryIndexes, ccsr *opencost.CloudCostSetRange) error {
 	if len(row.Data) < len(aqi.ColumnIndexes) {
 		return fmt.Errorf("rowToCloudCost: row with fewer than %d columns (has only %d)", len(aqi.ColumnIndexes), len(row.Data))
 	}
 
 	// Iterate through the slice of tag columns, assigning
 	// values to the column names, minus the tag prefix.
-	labels := kubecost.CloudCostLabels{}
+	labels := opencost.CloudCostLabels{}
 	labelValues := []string{}
 	for _, tagColumnName := range aqi.TagColumns {
 		labelName := strings.TrimPrefix(tagColumnName, LabelColumnPrefix)
@@ -382,7 +382,7 @@ func (ai *AthenaIntegration) RowToCloudCost(row types.Row, aqi AthenaQueryIndexe
 		providerID = ParseARN(providerID)
 	}
 
-	if productCode == "AmazonEKS" && category == kubecost.ComputeCategory {
+	if productCode == "AmazonEKS" && category == opencost.ComputeCategory {
 		if strings.Contains(usageType, "CPU") {
 			providerID = fmt.Sprintf("%s/CPU", providerID)
 		} else if strings.Contains(usageType, "GB") {
@@ -390,9 +390,9 @@ func (ai *AthenaIntegration) RowToCloudCost(row types.Row, aqi AthenaQueryIndexe
 		}
 	}
 
-	properties := kubecost.CloudCostProperties{
+	properties := opencost.CloudCostProperties{
 		ProviderID:      providerID,
-		Provider:        kubecost.AWSProvider,
+		Provider:        opencost.AWSProvider,
 		AccountID:       accountID,
 		InvoiceEntityID: invoiceEntityID,
 		Service:         productCode,
@@ -406,26 +406,26 @@ func (ai *AthenaIntegration) RowToCloudCost(row types.Row, aqi AthenaQueryIndexe
 	}
 	end := start.AddDate(0, 0, 1)
 
-	cc := &kubecost.CloudCost{
+	cc := &opencost.CloudCost{
 		Properties: &properties,
-		Window:     kubecost.NewWindow(&start, &end),
-		ListCost: kubecost.CostMetric{
+		Window:     opencost.NewWindow(&start, &end),
+		ListCost: opencost.CostMetric{
 			Cost:              listCost,
 			KubernetesPercent: k8sPct,
 		},
-		NetCost: kubecost.CostMetric{
+		NetCost: opencost.CostMetric{
 			Cost:              netCost,
 			KubernetesPercent: k8sPct,
 		},
-		AmortizedNetCost: kubecost.CostMetric{
+		AmortizedNetCost: opencost.CostMetric{
 			Cost:              amortizedNetCost,
 			KubernetesPercent: k8sPct,
 		},
-		AmortizedCost: kubecost.CostMetric{
+		AmortizedCost: opencost.CostMetric{
 			Cost:              amortizedCost,
 			KubernetesPercent: k8sPct,
 		},
-		InvoicedCost: kubecost.CostMetric{
+		InvoicedCost: opencost.CostMetric{
 			Cost:              netCost, // We are using Net Cost for Invoiced Cost for now as it is the closest approximation
 			KubernetesPercent: k8sPct,
 		},

+ 10 - 10
pkg/cloud/aws/athenaquerier.go

@@ -11,8 +11,8 @@ import (
 	"github.com/aws/aws-sdk-go-v2/aws"
 	"github.com/aws/aws-sdk-go-v2/service/athena"
 	"github.com/aws/aws-sdk-go-v2/service/athena/types"
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/stringutil"
 	"github.com/opencost/opencost/pkg/cloud"
 )
@@ -203,34 +203,34 @@ func GetAthenaRowValueFloat(row types.Row, queryColumnIndexes map[string]int, co
 func SelectAWSCategory(providerID, usageType, service string) string {
 	// Network has the highest priority and is based on the usage type ending in "Bytes"
 	if strings.HasSuffix(usageType, "Bytes") {
-		return kubecost.NetworkCategory
+		return opencost.NetworkCategory
 	}
 	// The node and volume conditions are mutually exclusive.
 	// Provider ID has prefix "i-"
 	if strings.HasPrefix(providerID, "i-") {
-		return kubecost.ComputeCategory
+		return opencost.ComputeCategory
 	}
 	// Provider ID has prefix "vol-"
 	if strings.HasPrefix(providerID, "vol-") {
-		return kubecost.StorageCategory
+		return opencost.StorageCategory
 	}
 
 	// Default categories based on service
 	switch strings.ToUpper(service) {
 	case "AWSELB", "AWSGLUE", "AMAZONROUTE53":
-		return kubecost.NetworkCategory
+		return opencost.NetworkCategory
 	case "AMAZONEC2", "AWSLAMBDA", "AMAZONELASTICACHE":
-		return kubecost.ComputeCategory
+		return opencost.ComputeCategory
 	case "AMAZONEKS":
 		// Check if line item is a fargate pod
 		if strings.Contains(providerID, ":pod/") {
-			return kubecost.ComputeCategory
+			return opencost.ComputeCategory
 		}
-		return kubecost.ManagementCategory
+		return opencost.ManagementCategory
 	case "AMAZONS3", "AMAZONATHENA", "AMAZONRDS", "AMAZONDYNAMODB", "AWSSECRETSMANAGER", "AMAZONFSX":
-		return kubecost.StorageCategory
+		return opencost.StorageCategory
 	default:
-		return kubecost.OtherCategory
+		return opencost.OtherCategory
 	}
 }
 

+ 2 - 2
pkg/cloud/aws/provider.go

@@ -17,12 +17,12 @@ import (
 	"time"
 
 	"github.com/aws/smithy-go"
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/pkg/cloud/models"
 	"github.com/opencost/opencost/pkg/cloud/utils"
 
 	"github.com/opencost/opencost/core/pkg/env"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util"
 	"github.com/opencost/opencost/core/pkg/util/fileutil"
 	"github.com/opencost/opencost/core/pkg/util/json"
@@ -1483,7 +1483,7 @@ func (awsProvider *AWS) ClusterInfo() (map[string]string, error) {
 
 	m := make(map[string]string)
 	m["name"] = clusterName
-	m["provider"] = kubecost.AWSProvider
+	m["provider"] = opencost.AWSProvider
 	m["account"] = clusterAccountID
 	m["region"] = awsProvider.ClusterRegion
 	m["id"] = ocenv.GetClusterID()

+ 2 - 2
pkg/cloud/aws/s3configuration.go

@@ -4,7 +4,7 @@ import (
 	"fmt"
 
 	"github.com/aws/aws-sdk-go-v2/aws"
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/json"
 	"github.com/opencost/opencost/pkg/cloud"
 )
@@ -91,7 +91,7 @@ func (s3c *S3Configuration) Key() string {
 }
 
 func (s3c *S3Configuration) Provider() string {
-	return kubecost.AWSProvider
+	return opencost.AWSProvider
 }
 
 func (s3c *S3Configuration) UnmarshalJSON(b []byte) error {

+ 14 - 14
pkg/cloud/aws/s3selectintegration.go

@@ -8,8 +8,8 @@ import (
 	"time"
 
 	"github.com/aws/aws-sdk-go-v2/service/s3"
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 )
 
 const S3SelectDateLayout = "2006-01-02T15:04:05Z"
@@ -37,11 +37,11 @@ type S3SelectIntegration struct {
 func (s3si *S3SelectIntegration) GetCloudCost(
 	start,
 	end time.Time,
-) (*kubecost.CloudCostSetRange, error) {
+) (*opencost.CloudCostSetRange, error) {
 	log.Infof(
 		"S3SelectIntegration[%s]: GetCloudCost: %s",
 		s3si.Key(),
-		kubecost.NewWindow(&start, &end).String(),
+		opencost.NewWindow(&start, &end).String(),
 	)
 
 	// Set midnight yesterday as last point in time reconciliation data
@@ -54,10 +54,10 @@ func (s3si *S3SelectIntegration) GetCloudCost(
 	}
 
 	// ccsr to populate with cloudcosts.
-	ccsr, err := kubecost.NewCloudCostSetRange(
+	ccsr, err := opencost.NewCloudCostSetRange(
 		start,
 		end,
-		kubecost.AccumulateOptionDay,
+		opencost.AccumulateOptionDay,
 		s3si.Key(),
 	)
 	if err != nil {
@@ -188,8 +188,8 @@ func (s3si *S3SelectIntegration) GetCloudCost(
 				itemProviderID = ParseARN(itemProviderID)
 			}
 
-			properties := kubecost.CloudCostProperties{}
-			properties.Provider = kubecost.AWSProvider
+			properties := opencost.CloudCostProperties{}
+			properties.Provider = opencost.AWSProvider
 			properties.AccountID = itemAccountID
 			properties.Category = category
 			properties.Service = itemProductCode
@@ -207,22 +207,22 @@ func (s3si *S3SelectIntegration) GetCloudCost(
 			itemStart = itemStart.Truncate(time.Hour * 24)
 			itemEnd := itemStart.AddDate(0, 0, 1)
 
-			cc := &kubecost.CloudCost{
+			cc := &opencost.CloudCost{
 				Properties: &properties,
-				Window:     kubecost.NewWindow(&itemStart, &itemEnd),
-				ListCost: kubecost.CostMetric{
+				Window:     opencost.NewWindow(&itemStart, &itemEnd),
+				ListCost: opencost.CostMetric{
 					Cost: listCost,
 				},
-				NetCost: kubecost.CostMetric{
+				NetCost: opencost.CostMetric{
 					Cost: netCost,
 				},
-				AmortizedNetCost: kubecost.CostMetric{
+				AmortizedNetCost: opencost.CostMetric{
 					Cost: amortizedCost,
 				},
-				AmortizedCost: kubecost.CostMetric{
+				AmortizedCost: opencost.CostMetric{
 					Cost: amortizedCost,
 				},
-				InvoicedCost: kubecost.CostMetric{
+				InvoicedCost: opencost.CostMetric{
 					Cost: netCost,
 				},
 			}

+ 12 - 12
pkg/cloud/azure/azurestorageintegration.go

@@ -4,7 +4,7 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/timeutil"
 )
 
@@ -12,8 +12,8 @@ type AzureStorageIntegration struct {
 	AzureStorageBillingParser
 }
 
-func (asi *AzureStorageIntegration) GetCloudCost(start, end time.Time) (*kubecost.CloudCostSetRange, error) {
-	ccsr, err := kubecost.NewCloudCostSetRange(start, end, kubecost.AccumulateOptionDay, asi.Key())
+func (asi *AzureStorageIntegration) GetCloudCost(start, end time.Time) (*opencost.CloudCostSetRange, error) {
+	ccsr, err := opencost.NewCloudCostSetRange(start, end, opencost.AccumulateOptionDay, asi.Key())
 	if err != nil {
 		return nil, err
 	}
@@ -21,7 +21,7 @@ func (asi *AzureStorageIntegration) GetCloudCost(start, end time.Time) (*kubecos
 	err = asi.ParseBillingData(start, end, func(abv *BillingRowValues) error {
 		s := abv.Date
 		e := abv.Date.Add(timeutil.Day)
-		window := kubecost.NewWindow(&s, &e)
+		window := opencost.NewWindow(&s, &e)
 
 		k8sPtc := 0.0
 		if AzureIsK8s(abv.Tags) {
@@ -32,10 +32,10 @@ func (asi *AzureStorageIntegration) GetCloudCost(start, end time.Time) (*kubecos
 		// Create CloudCost
 		// Using the NetCost as a 'placeholder' for Invoiced and Amortized Net costs now,
 		// until we can revisit and spend the time to do the calculations correctly
-		cc := &kubecost.CloudCost{
-			Properties: &kubecost.CloudCostProperties{
+		cc := &opencost.CloudCost{
+			Properties: &opencost.CloudCostProperties{
 				ProviderID:      providerID,
-				Provider:        kubecost.AzureProvider,
+				Provider:        opencost.AzureProvider,
 				AccountID:       abv.SubscriptionID,
 				InvoiceEntityID: abv.InvoiceEntityID,
 				Service:         abv.Service,
@@ -43,25 +43,25 @@ func (asi *AzureStorageIntegration) GetCloudCost(start, end time.Time) (*kubecos
 				Labels:          abv.Tags,
 			},
 			Window: window,
-			AmortizedNetCost: kubecost.CostMetric{
+			AmortizedNetCost: opencost.CostMetric{
 				Cost:              abv.NetCost,
 				KubernetesPercent: k8sPtc,
 			},
-			InvoicedCost: kubecost.CostMetric{
+			InvoicedCost: opencost.CostMetric{
 				Cost:              abv.NetCost,
 				KubernetesPercent: k8sPtc,
 			},
-			ListCost: kubecost.CostMetric{
+			ListCost: opencost.CostMetric{
 				Cost:              abv.Cost,
 				KubernetesPercent: k8sPtc,
 			},
-			NetCost: kubecost.CostMetric{
+			NetCost: opencost.CostMetric{
 				Cost:              abv.NetCost,
 				KubernetesPercent: k8sPtc,
 			},
 			// NOTE: on Azure, there is no "AmortizedCost" per se, so we use
 			// AmortizedNetCost, or NetCost, instead.
-			AmortizedCost: kubecost.CostMetric{
+			AmortizedCost: opencost.CostMetric{
 				Cost:              abv.NetCost,
 				KubernetesPercent: k8sPtc,
 			},

+ 10 - 10
pkg/cloud/azure/billingexportparser.go

@@ -7,8 +7,8 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/json"
 )
 
@@ -32,19 +32,19 @@ type BillingRowValues struct {
 }
 
 func (brv *BillingRowValues) IsCompute(category string) bool {
-	if category == kubecost.ComputeCategory {
+	if category == opencost.ComputeCategory {
 		return true
 	}
 
-	if category == kubecost.StorageCategory || category == kubecost.NetworkCategory {
+	if category == opencost.StorageCategory || category == opencost.NetworkCategory {
 		if brv.Service == "Microsoft.Compute" {
 			return true
 		}
 	}
-	if category == kubecost.NetworkCategory && brv.MeterCategory == "Virtual Network" {
+	if category == opencost.NetworkCategory && brv.MeterCategory == "Virtual Network" {
 		return true
 	}
-	if category == kubecost.NetworkCategory && brv.MeterCategory == "Bandwidth" {
+	if category == opencost.NetworkCategory && brv.MeterCategory == "Bandwidth" {
 		return true
 	}
 	return false
@@ -270,7 +270,7 @@ func AzureSetProviderID(abv *BillingRowValues) (providerID string, isVMSSShared
 		return fmt.Sprintf("%v", value2), false
 	}
 
-	if category == kubecost.StorageCategory || (category == kubecost.NetworkCategory && abv.MeterCategory == "Bandwidth") {
+	if category == opencost.StorageCategory || (category == opencost.NetworkCategory && abv.MeterCategory == "Bandwidth") {
 		if value2, ok2 := abv.Tags["creationSource"]; ok2 {
 			creationSource := fmt.Sprintf("%v", value2)
 			return strings.TrimPrefix(creationSource, "aks-"), true
@@ -286,13 +286,13 @@ func AzureSetProviderID(abv *BillingRowValues) (providerID string, isVMSSShared
 
 func SelectAzureCategory(meterCategory string) string {
 	if meterCategory == "Virtual Machines" {
-		return kubecost.ComputeCategory
+		return opencost.ComputeCategory
 	} else if meterCategory == "Storage" {
-		return kubecost.StorageCategory
+		return opencost.StorageCategory
 	} else if meterCategory == "Load Balancer" || meterCategory == "Bandwidth" || meterCategory == "Virtual Network" {
-		return kubecost.NetworkCategory
+		return opencost.NetworkCategory
 	} else {
-		return kubecost.OtherCategory
+		return opencost.OtherCategory
 	}
 }
 

+ 2 - 2
pkg/cloud/azure/provider.go

@@ -21,8 +21,8 @@ import (
 	"github.com/Azure/go-autorest/autorest/azure"
 	"github.com/Azure/go-autorest/autorest/azure/auth"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util"
 	"github.com/opencost/opencost/core/pkg/util/fileutil"
 	"github.com/opencost/opencost/core/pkg/util/json"
@@ -1472,7 +1472,7 @@ func (az *Azure) ClusterInfo() (map[string]string, error) {
 	if c.ClusterName != "" {
 		m["name"] = c.ClusterName
 	}
-	m["provider"] = kubecost.AzureProvider
+	m["provider"] = opencost.AzureProvider
 	m["account"] = az.ClusterAccountID
 	m["region"] = az.ClusterRegion
 	m["remoteReadEnabled"] = strconv.FormatBool(remoteEnabled)

+ 2 - 2
pkg/cloud/azure/storageconfiguration.go

@@ -3,7 +3,7 @@ package azure
 import (
 	"fmt"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/json"
 	"github.com/opencost/opencost/pkg/cloud"
 )
@@ -107,7 +107,7 @@ func (sc *StorageConfiguration) Key() string {
 }
 
 func (sc *StorageConfiguration) Provider() string {
-	return kubecost.AzureProvider
+	return opencost.AzureProvider
 }
 
 func (sc *StorageConfiguration) UnmarshalJSON(b []byte) error {

+ 2 - 2
pkg/cloud/config/mock.go

@@ -3,7 +3,7 @@ package config
 import (
 	"fmt"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/pkg/cloud"
 )
 
@@ -83,7 +83,7 @@ func (mkc *MockKeyedConfig) Key() string {
 }
 
 func (mkc *MockKeyedConfig) Provider() string {
-	return kubecost.CustomProvider
+	return opencost.CustomProvider
 }
 
 type MockKeyedConfigWatcher struct {

+ 2 - 2
pkg/cloud/gcp/bigqueryconfiguration.go

@@ -6,7 +6,7 @@ import (
 	"strings"
 
 	"cloud.google.com/go/bigquery"
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/json"
 	"github.com/opencost/opencost/pkg/cloud"
 )
@@ -93,7 +93,7 @@ func (bqc *BigQueryConfiguration) Key() string {
 }
 
 func (bqc *BigQueryConfiguration) Provider() string {
-	return kubecost.GCPProvider
+	return opencost.GCPProvider
 }
 
 func (bqc *BigQueryConfiguration) GetBillingDataDataset() string {

+ 3 - 3
pkg/cloud/gcp/bigqueryintegration.go

@@ -7,8 +7,8 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"google.golang.org/api/iterator"
 )
 
@@ -32,7 +32,7 @@ const (
 const BiqQueryWherePartitionFmt = `DATE(_PARTITIONTIME) >= "%s" AND DATE(_PARTITIONTIME) < "%s"`
 const BiqQueryWhereDateFmt = `usage_start_time >= "%s" AND usage_start_time < "%s"`
 
-func (bqi *BigQueryIntegration) GetCloudCost(start time.Time, end time.Time) (*kubecost.CloudCostSetRange, error) {
+func (bqi *BigQueryIntegration) GetCloudCost(start time.Time, end time.Time) (*opencost.CloudCostSetRange, error) {
 	cudRates, err := bqi.GetFlexibleCUDRates(start, end)
 	if err != nil {
 		return nil, fmt.Errorf("error retrieving CUD rates: %w", err)
@@ -79,7 +79,7 @@ func (bqi *BigQueryIntegration) GetCloudCost(start time.Time, end time.Time) (*k
 
 	// Perform Query and parse values
 
-	ccsr, err := kubecost.NewCloudCostSetRange(start, end, kubecost.AccumulateOptionDay, bqi.Key())
+	ccsr, err := opencost.NewCloudCostSetRange(start, end, opencost.AccumulateOptionDay, bqi.Key())
 	if err != nil {
 		return ccsr, fmt.Errorf("error creating new CloudCostSetRange: %s", err)
 	}

+ 2 - 2
pkg/cloud/gcp/bigqueryintegration_test.go

@@ -6,7 +6,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/timeutil"
 )
 
@@ -25,7 +25,7 @@ func TestBigQueryIntegration_GetCloudCost(t *testing.T) {
 		t.Fatalf("failed to unmarshal config from JSON: %s", err.Error())
 	}
 
-	today := kubecost.RoundBack(time.Now().UTC(), timeutil.Day)
+	today := opencost.RoundBack(time.Now().UTC(), timeutil.Day)
 
 	testCases := map[string]struct {
 		integration *BigQueryIntegration

+ 12 - 12
pkg/cloud/gcp/bigqueryintegration_types.go

@@ -6,14 +6,14 @@ import (
 	"time"
 
 	"cloud.google.com/go/bigquery"
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/json"
 	"github.com/opencost/opencost/core/pkg/util/timeutil"
 )
 
 type CloudCostLoader struct {
-	CloudCost        *kubecost.CloudCost
+	CloudCost        *opencost.CloudCost
 	FlexibleCUDRates map[time.Time]FlexibleCUDRates
 }
 
@@ -21,10 +21,10 @@ type CloudCostLoader struct {
 func (ccl *CloudCostLoader) Load(values []bigquery.Value, schema bigquery.Schema) error {
 
 	// Create Cloud Cost Properties
-	properties := kubecost.CloudCostProperties{
-		Provider: kubecost.GCPProvider,
+	properties := opencost.CloudCostProperties{
+		Provider: opencost.GCPProvider,
 	}
-	var window kubecost.Window
+	var window opencost.Window
 	var description string
 	var cost float64
 	var listCost float64
@@ -53,7 +53,7 @@ func (ccl *CloudCostLoader) Load(values []bigquery.Value, schema bigquery.Schema
 			// start and end will be the day that the usage occurred on
 			s := usageDate
 			e := s.Add(timeutil.Day)
-			window = kubecost.NewClosedWindow(s, e)
+			window = opencost.NewClosedWindow(s, e)
 		case BillingAccountIDColumnName:
 			invoiceEntityID, ok := values[i].(string)
 			if !ok {
@@ -217,26 +217,26 @@ func (ccl *CloudCostLoader) Load(values []bigquery.Value, schema bigquery.Schema
 		k8sPercent = 1.0
 	}
 
-	ccl.CloudCost = &kubecost.CloudCost{
+	ccl.CloudCost = &opencost.CloudCost{
 		Properties: &properties,
 		Window:     window,
-		ListCost: kubecost.CostMetric{
+		ListCost: opencost.CostMetric{
 			Cost:              listCost,
 			KubernetesPercent: k8sPercent,
 		},
-		AmortizedCost: kubecost.CostMetric{
+		AmortizedCost: opencost.CostMetric{
 			Cost:              amortizedCost,
 			KubernetesPercent: k8sPercent,
 		},
-		AmortizedNetCost: kubecost.CostMetric{
+		AmortizedNetCost: opencost.CostMetric{
 			Cost:              amortizedNetCost,
 			KubernetesPercent: k8sPercent,
 		},
-		InvoicedCost: kubecost.CostMetric{
+		InvoicedCost: opencost.CostMetric{
 			Cost:              invoicedCost,
 			KubernetesPercent: k8sPercent,
 		},
-		NetCost: kubecost.CostMetric{
+		NetCost: opencost.CostMetric{
 			Cost:              netCost,
 			KubernetesPercent: k8sPercent,
 		},

+ 20 - 20
pkg/cloud/gcp/cloudcost.go

@@ -4,7 +4,7 @@ import (
 	"regexp"
 	"strings"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 )
 
 func IsK8s(labels map[string]string) bool {
@@ -39,62 +39,62 @@ func SelectCategory(service, description string) string {
 
 	// Network descriptions
 	if strings.Contains(d, "download") {
-		return kubecost.NetworkCategory
+		return opencost.NetworkCategory
 	}
 	if strings.Contains(d, "network") {
-		return kubecost.NetworkCategory
+		return opencost.NetworkCategory
 	}
 	if strings.Contains(d, "ingress") {
-		return kubecost.NetworkCategory
+		return opencost.NetworkCategory
 	}
 	if strings.Contains(d, "egress") {
-		return kubecost.NetworkCategory
+		return opencost.NetworkCategory
 	}
 	if strings.Contains(d, "static ip") {
-		return kubecost.NetworkCategory
+		return opencost.NetworkCategory
 	}
 	if strings.Contains(d, "external ip") {
-		return kubecost.NetworkCategory
+		return opencost.NetworkCategory
 	}
 	if strings.Contains(d, "load balanced") {
-		return kubecost.NetworkCategory
+		return opencost.NetworkCategory
 	}
 	if strings.Contains(d, "licensing fee") {
-		return kubecost.OtherCategory
+		return opencost.OtherCategory
 	}
 
 	// Storage Descriptions
 	if strings.Contains(d, "storage") {
-		return kubecost.StorageCategory
+		return opencost.StorageCategory
 	}
 	if strings.Contains(d, "pd capacity") {
-		return kubecost.StorageCategory
+		return opencost.StorageCategory
 	}
 	if strings.Contains(d, "pd iops") {
-		return kubecost.StorageCategory
+		return opencost.StorageCategory
 	}
 	if strings.Contains(d, "pd snapshot") {
-		return kubecost.StorageCategory
+		return opencost.StorageCategory
 	}
 
 	// Service Defaults
 	if strings.Contains(s, "storage") {
-		return kubecost.StorageCategory
+		return opencost.StorageCategory
 	}
 	if strings.Contains(s, "compute") {
-		return kubecost.ComputeCategory
+		return opencost.ComputeCategory
 	}
 	if strings.Contains(s, "sql") {
-		return kubecost.StorageCategory
+		return opencost.StorageCategory
 	}
 	if strings.Contains(s, "bigquery") {
-		return kubecost.StorageCategory
+		return opencost.StorageCategory
 	}
 	if strings.Contains(s, "kubernetes") {
-		return kubecost.ManagementCategory
+		return opencost.ManagementCategory
 	} else if strings.Contains(s, "pub/sub") {
-		return kubecost.NetworkCategory
+		return opencost.NetworkCategory
 	}
 
-	return kubecost.OtherCategory
+	return opencost.OtherCategory
 }

+ 2 - 2
pkg/cloud/gcp/provider.go

@@ -14,12 +14,12 @@ import (
 	"sync"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/pkg/cloud/aws"
 	"github.com/opencost/opencost/pkg/cloud/models"
 	"github.com/opencost/opencost/pkg/cloud/utils"
 
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util"
 	"github.com/opencost/opencost/core/pkg/util/fileutil"
 	"github.com/opencost/opencost/core/pkg/util/json"
@@ -340,7 +340,7 @@ func (gcp *GCP) ClusterInfo() (map[string]string, error) {
 
 	m := make(map[string]string)
 	m["name"] = attribute
-	m["provider"] = kubecost.GCPProvider
+	m["provider"] = opencost.GCPProvider
 	m["region"] = gcp.ClusterRegion
 	m["account"] = gcp.ClusterAccountID
 	m["project"] = gcp.ClusterProjectID

+ 2 - 2
pkg/cloud/provider/customprovider.go

@@ -8,8 +8,8 @@ import (
 	"sync"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util"
 	"github.com/opencost/opencost/core/pkg/util/json"
 	"github.com/opencost/opencost/pkg/cloud/models"
@@ -146,7 +146,7 @@ func (cp *CustomProvider) ClusterInfo() (map[string]string, error) {
 	if conf.ClusterName != "" {
 		m["name"] = conf.ClusterName
 	}
-	m["provider"] = kubecost.CustomProvider
+	m["provider"] = opencost.CustomProvider
 	m["region"] = cp.ClusterRegion
 	m["account"] = cp.ClusterAccountID
 	m["id"] = env.GetClusterID()

+ 13 - 13
pkg/cloud/provider/provider.go

@@ -8,7 +8,6 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/pkg/cloud/alibaba"
 	"github.com/opencost/opencost/pkg/cloud/aws"
 	"github.com/opencost/opencost/pkg/cloud/azure"
@@ -16,6 +15,7 @@ import (
 	"github.com/opencost/opencost/pkg/cloud/models"
 	"github.com/opencost/opencost/pkg/cloud/scaleway"
 
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util"
 
 	"cloud.google.com/go/compute/metadata"
@@ -170,7 +170,7 @@ func NewProvider(cache clustercache.ClusterCache, apiKey string, config *config.
 	})
 
 	switch cp.provider {
-	case kubecost.CSVProvider:
+	case opencost.CSVProvider:
 		log.Infof("Using CSV Provider with CSV at %s", env.GetCSVPath())
 		return &CSVProvider{
 			CSVLocation: env.GetCSVPath(),
@@ -181,7 +181,7 @@ func NewProvider(cache clustercache.ClusterCache, apiKey string, config *config.
 				Config:           NewProviderConfig(config, cp.configFileName),
 			},
 		}, nil
-	case kubecost.GCPProvider:
+	case opencost.GCPProvider:
 		log.Info("Found ProviderID starting with \"gce\", using GCP Provider")
 		if apiKey == "" {
 			return nil, errors.New("Supply a GCP Key to start getting data")
@@ -204,7 +204,7 @@ func NewProvider(cache clustercache.ClusterCache, apiKey string, config *config.
 					Timeout: 5 * time.Second,
 				}),
 		}, nil
-	case kubecost.AWSProvider:
+	case opencost.AWSProvider:
 		log.Info("Found ProviderID starting with \"aws\", using AWS Provider")
 		return &aws.AWS{
 			Clientset:            cache,
@@ -213,7 +213,7 @@ func NewProvider(cache clustercache.ClusterCache, apiKey string, config *config.
 			ClusterAccountID:     cp.accountID,
 			ServiceAccountChecks: models.NewServiceAccountChecks(),
 		}, nil
-	case kubecost.AzureProvider:
+	case opencost.AzureProvider:
 		log.Info("Found ProviderID starting with \"azure\", using Azure Provider")
 		return &azure.Azure{
 			Clientset:            cache,
@@ -222,7 +222,7 @@ func NewProvider(cache clustercache.ClusterCache, apiKey string, config *config.
 			ClusterAccountID:     cp.accountID,
 			ServiceAccountChecks: models.NewServiceAccountChecks(),
 		}, nil
-	case kubecost.AlibabaProvider:
+	case opencost.AlibabaProvider:
 		log.Info("Found ProviderID starting with \"alibaba\", using Alibaba Cloud Provider")
 		return &alibaba.Alibaba{
 			Clientset:            cache,
@@ -231,7 +231,7 @@ func NewProvider(cache clustercache.ClusterCache, apiKey string, config *config.
 			ClusterAccountId:     cp.accountID,
 			ServiceAccountChecks: models.NewServiceAccountChecks(),
 		}, nil
-	case kubecost.ScalewayProvider:
+	case opencost.ScalewayProvider:
 		log.Info("Found ProviderID starting with \"scaleway\", using Scaleway Provider")
 		return &scaleway.Scaleway{
 			Clientset:        cache,
@@ -271,25 +271,25 @@ func getClusterProperties(node *v1.Node) clusterProperties {
 	}
 	// The second conditional is mainly if you're running opencost outside of GCE, say in a local environment.
 	if metadata.OnGCE() || strings.HasPrefix(providerID, "gce") {
-		cp.provider = kubecost.GCPProvider
+		cp.provider = opencost.GCPProvider
 		cp.configFileName = "gcp.json"
 		cp.projectID = gcp.ParseGCPProjectID(providerID)
 	} else if strings.HasPrefix(providerID, "aws") {
-		cp.provider = kubecost.AWSProvider
+		cp.provider = opencost.AWSProvider
 		cp.configFileName = "aws.json"
 	} else if strings.HasPrefix(providerID, "azure") {
-		cp.provider = kubecost.AzureProvider
+		cp.provider = opencost.AzureProvider
 		cp.configFileName = "azure.json"
 		cp.accountID = azure.ParseAzureSubscriptionID(providerID)
 	} else if strings.HasPrefix(providerID, "scaleway") { // the scaleway provider ID looks like scaleway://instance/<instance_id>
-		cp.provider = kubecost.ScalewayProvider
+		cp.provider = opencost.ScalewayProvider
 		cp.configFileName = "scaleway.json"
 	} else if strings.Contains(node.Status.NodeInfo.KubeletVersion, "aliyun") { // provider ID is not prefix with any distinct keyword like other providers
-		cp.provider = kubecost.AlibabaProvider
+		cp.provider = opencost.AlibabaProvider
 		cp.configFileName = "alibaba.json"
 	}
 	if env.IsUseCSVProvider() {
-		cp.provider = kubecost.CSVProvider
+		cp.provider = opencost.CSVProvider
 	}
 
 	return cp

+ 2 - 2
pkg/cloud/scaleway/provider.go

@@ -9,10 +9,10 @@ import (
 	"sync"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/pkg/cloud/models"
 	"github.com/opencost/opencost/pkg/cloud/utils"
 
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util"
 	"github.com/opencost/opencost/core/pkg/util/json"
 	"github.com/opencost/opencost/pkg/clustercache"
@@ -295,7 +295,7 @@ func (scw *Scaleway) ClusterInfo() (map[string]string, error) {
 	if c.ClusterName != "" {
 		m["name"] = c.ClusterName
 	}
-	m["provider"] = kubecost.ScalewayProvider
+	m["provider"] = opencost.ScalewayProvider
 	m["region"] = scw.ClusterRegion
 	m["account"] = scw.ClusterAccountID
 	m["remoteReadEnabled"] = strconv.FormatBool(remoteEnabled)

+ 7 - 7
pkg/cloudcost/ingestionmanager.go

@@ -5,8 +5,8 @@ import (
 	"sync"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/pkg/cloud"
 	"github.com/opencost/opencost/pkg/cloud/config"
 )
@@ -135,9 +135,9 @@ func (im *IngestionManager) Rebuild(integrationKey string) error {
 func (im *IngestionManager) RepairAll(start, end time.Time) error {
 	im.lock.Lock()
 	defer im.lock.Unlock()
-	s := kubecost.RoundForward(start, im.config.Resolution)
-	e := kubecost.RoundForward(end, im.config.Resolution)
-	windows, err := kubecost.GetWindowsForQueryWindow(s, e, im.config.QueryWindow)
+	s := opencost.RoundForward(start, im.config.Resolution)
+	e := opencost.RoundForward(end, im.config.Resolution)
+	windows, err := opencost.GetWindowsForQueryWindow(s, e, im.config.QueryWindow)
 	if err != nil {
 		return fmt.Errorf("CloudCost: IngestionManager: Repair could not retrieve windows: %s", err.Error())
 	}
@@ -156,9 +156,9 @@ func (im *IngestionManager) RepairAll(start, end time.Time) error {
 func (im *IngestionManager) Repair(integrationKey string, start, end time.Time) error {
 	im.lock.Lock()
 	defer im.lock.Unlock()
-	s := kubecost.RoundForward(start, im.config.Resolution)
-	e := kubecost.RoundForward(end, im.config.Resolution)
-	windows, err := kubecost.GetWindowsForQueryWindow(s, e, im.config.QueryWindow)
+	s := opencost.RoundForward(start, im.config.Resolution)
+	e := opencost.RoundForward(end, im.config.Resolution)
+	windows, err := opencost.GetWindowsForQueryWindow(s, e, im.config.QueryWindow)
 	if err != nil {
 		return fmt.Errorf("CloudCost: IngestionManager: Repair could not retrieve windows: %s", err.Error())
 	}

+ 17 - 17
pkg/cloudcost/ingestor.go

@@ -6,8 +6,8 @@ import (
 	"sync/atomic"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/stringutil"
 	"github.com/opencost/opencost/core/pkg/util/timeutil"
 	"github.com/opencost/opencost/pkg/cloud"
@@ -21,7 +21,7 @@ type IngestorStatus struct {
 	LastRun          time.Time
 	NextRun          time.Time
 	Runs             int
-	Coverage         kubecost.Window
+	Coverage         opencost.Window
 	ConnectionStatus cloud.ConnectionStatus
 }
 
@@ -57,7 +57,7 @@ type ingestor struct {
 	lastRun      time.Time
 	runs         int
 	creationTime time.Time
-	coverage     kubecost.Window
+	coverage     opencost.Window
 	coverageLock sync.Mutex
 	isRunning    atomic.Bool
 	isStopping   atomic.Bool
@@ -78,7 +78,7 @@ func NewIngestor(ingestorConfig IngestorConfig, repo Repository, config cloud.Ke
 		return nil, fmt.Errorf("CloudCost: NewIngestor: provider integration config was not a valid type: %T", config)
 	}
 	now := time.Now().UTC()
-	midnight := kubecost.RoundForward(now, timeutil.Day)
+	midnight := opencost.RoundForward(now, timeutil.Day)
 	return &ingestor{
 		config:       ingestorConfig,
 		repo:         repo,
@@ -86,14 +86,14 @@ func NewIngestor(ingestorConfig IngestorConfig, repo Repository, config cloud.Ke
 		integration:  cci,
 		creationTime: now,
 		lastRun:      now,
-		coverage:     kubecost.NewClosedWindow(midnight, midnight),
+		coverage:     opencost.NewClosedWindow(midnight, midnight),
 	}, nil
 }
 
 func (ing *ingestor) LoadWindow(start, end time.Time) {
-	windows, err := kubecost.GetWindows(start, end, timeutil.Day)
+	windows, err := opencost.GetWindows(start, end, timeutil.Day)
 	if err != nil {
-		log.Errorf("CloudCost[%s]: ingestor: invalid window %s", ing.key, kubecost.NewWindow(&start, &end))
+		log.Errorf("CloudCost[%s]: ingestor: invalid window %s", ing.key, opencost.NewWindow(&start, &end))
 		return
 	}
 
@@ -113,10 +113,10 @@ func (ing *ingestor) LoadWindow(start, end time.Time) {
 }
 
 func (ing *ingestor) BuildWindow(start, end time.Time) {
-	log.Infof("CloudCost[%s]: ingestor: building window %s", ing.key, kubecost.NewWindow(&start, &end))
+	log.Infof("CloudCost[%s]: ingestor: building window %s", ing.key, opencost.NewWindow(&start, &end))
 	ccsr, err := ing.integration.GetCloudCost(start, end)
 	if err != nil {
-		log.Errorf("CloudCost[%s]: ingestor: build failed for window %s: %s", ing.key, kubecost.NewWindow(&start, &end), err.Error())
+		log.Errorf("CloudCost[%s]: ingestor: build failed for window %s: %s", ing.key, opencost.NewWindow(&start, &end), err.Error())
 		return
 	}
 	for _, ccs := range ccsr.CloudCostSets {
@@ -205,7 +205,7 @@ func (ing *ingestor) build(rebuild bool) {
 	buildStart := time.Now()
 
 	// Build as far back as the configures build Duration
-	limit := kubecost.RoundBack(time.Now().UTC().Add(-ing.config.Duration), ing.config.Resolution)
+	limit := opencost.RoundBack(time.Now().UTC().Add(-ing.config.Duration), ing.config.Resolution)
 
 	queryWindowStr := timeutil.FormatStoreResolution(ing.config.QueryWindow)
 	log.Infof("CloudCost[%s]: ingestor: build[%s]: Starting build back to %s in blocks of %s", ing.key, ing.runID, limit.String(), queryWindowStr)
@@ -216,7 +216,7 @@ func (ing *ingestor) build(rebuild bool) {
 
 	// Round end times back to nearest Resolution points in the past,
 	// querying for exactly one interval
-	e := kubecost.RoundBack(time.Now().UTC(), ing.config.Resolution)
+	e := opencost.RoundBack(time.Now().UTC(), ing.config.Resolution)
 	s := e.Add(-ing.config.QueryWindow)
 
 	// Continue until limit is reached
@@ -239,7 +239,7 @@ func (ing *ingestor) build(rebuild bool) {
 			ing.LoadWindow(s, e)
 		}
 
-		log.Infof("CloudCost[%s]: ingestor: build[%s]:  %s in %v", ing.key, ing.runID, kubecost.NewClosedWindow(s, e), time.Since(stepStart))
+		log.Infof("CloudCost[%s]: ingestor: build[%s]:  %s in %v", ing.key, ing.runID, opencost.NewClosedWindow(s, e), time.Since(stepStart))
 
 		// Shift to next QueryWindow
 		s = s.Add(-ing.config.QueryWindow)
@@ -288,7 +288,7 @@ func (ing *ingestor) run() {
 
 		// Round start time back to the nearest Resolution point in the past from the
 		// last update to the QueryWindow
-		s := kubecost.RoundBack(start.UTC(), ing.config.Resolution)
+		s := opencost.RoundBack(start.UTC(), ing.config.Resolution)
 		e := s.Add(ing.config.QueryWindow)
 
 		// Start with a window of the configured Duration and starting on the given
@@ -300,19 +300,19 @@ func (ing *ingestor) run() {
 			profStart := time.Now()
 			ing.BuildWindow(s, e)
 
-			log.Debugf("CloudCost[%s]: ingestor: Run[%s]: completed %s in %v", ing.key, ing.runID, kubecost.NewWindow(&s, &e), time.Since(profStart))
+			log.Debugf("CloudCost[%s]: ingestor: Run[%s]: completed %s in %v", ing.key, ing.runID, opencost.NewWindow(&s, &e), time.Since(profStart))
 
 			s = s.Add(ing.config.QueryWindow)
 			e = e.Add(ing.config.QueryWindow)
 			// prevent builds into the future
 			if e.After(time.Now().UTC()) {
-				e = kubecost.RoundForward(time.Now().UTC(), ing.config.Resolution)
+				e = opencost.RoundForward(time.Now().UTC(), ing.config.Resolution)
 			}
 
 		}
 		ing.lastRun = time.Now().UTC()
 
-		limit := kubecost.RoundBack(time.Now().UTC(), ing.config.Resolution).Add(-ing.config.Duration)
+		limit := opencost.RoundBack(time.Now().UTC(), ing.config.Resolution).Add(-ing.config.Duration)
 		err := ing.repo.Expire(limit)
 		if err != nil {
 			log.Errorf("CloudCost: Ingestor: failed to expire Data: %s", err)
@@ -328,7 +328,7 @@ func (ing *ingestor) run() {
 	}
 }
 
-func (ing *ingestor) expandCoverage(window kubecost.Window) {
+func (ing *ingestor) expandCoverage(window opencost.Window) {
 	if window.IsOpen() {
 		return
 	}

+ 2 - 2
pkg/cloudcost/integration.go

@@ -3,7 +3,7 @@ package cloudcost
 import (
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/pkg/cloud"
 	"github.com/opencost/opencost/pkg/cloud/alibaba"
 	"github.com/opencost/opencost/pkg/cloud/aws"
@@ -13,7 +13,7 @@ import (
 
 // CloudCostIntegration is an interface for retrieving daily granularity CloudCost data for a given range
 type CloudCostIntegration interface {
-	GetCloudCost(time.Time, time.Time) (*kubecost.CloudCostSetRange, error)
+	GetCloudCost(time.Time, time.Time) (*opencost.CloudCostSetRange, error)
 	GetStatus() cloud.ConnectionStatus
 }
 

+ 6 - 6
pkg/cloudcost/memoryrepository.go

@@ -5,7 +5,7 @@ import (
 	"sync"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"golang.org/x/exp/maps"
 )
 
@@ -13,12 +13,12 @@ import (
 // RWMutex to make it threadsafe
 type MemoryRepository struct {
 	rwLock sync.RWMutex
-	data   map[string]map[time.Time]*kubecost.CloudCostSet
+	data   map[string]map[time.Time]*opencost.CloudCostSet
 }
 
 func NewMemoryRepository() *MemoryRepository {
 	return &MemoryRepository{
-		data: make(map[string]map[time.Time]*kubecost.CloudCostSet),
+		data: make(map[string]map[time.Time]*opencost.CloudCostSet),
 	}
 }
 
@@ -35,7 +35,7 @@ func (m *MemoryRepository) Has(startTime time.Time, billingIntegration string) (
 	return ook, nil
 }
 
-func (m *MemoryRepository) Get(startTime time.Time, billingIntegration string) (*kubecost.CloudCostSet, error) {
+func (m *MemoryRepository) Get(startTime time.Time, billingIntegration string) (*opencost.CloudCostSet, error) {
 	m.rwLock.RLock()
 	defer m.rwLock.RUnlock()
 
@@ -59,7 +59,7 @@ func (m *MemoryRepository) Keys() ([]string, error) {
 	return keys, nil
 }
 
-func (m *MemoryRepository) Put(ccs *kubecost.CloudCostSet) error {
+func (m *MemoryRepository) Put(ccs *opencost.CloudCostSet) error {
 	m.rwLock.Lock()
 	defer m.rwLock.Unlock()
 
@@ -76,7 +76,7 @@ func (m *MemoryRepository) Put(ccs *kubecost.CloudCostSet) error {
 	}
 
 	if _, ok := m.data[ccs.Integration]; !ok {
-		m.data[ccs.Integration] = make(map[time.Time]*kubecost.CloudCostSet)
+		m.data[ccs.Integration] = make(map[time.Time]*opencost.CloudCostSet)
 	}
 
 	m.data[ccs.Integration][ccs.Window.Start().UTC()] = ccs

+ 43 - 43
pkg/cloudcost/memoryrepository_test.go

@@ -6,27 +6,27 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/timeutil"
 )
 
 func TestMemoryRepository_Get(t *testing.T) {
 	defaultStart := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC)
 	defaultEnd := defaultStart.Add(timeutil.Day)
-	defaultData := map[string]map[time.Time]*kubecost.CloudCostSet{
+	defaultData := map[string]map[time.Time]*opencost.CloudCostSet{
 		"key-1": {
 			defaultStart: DefaultMockCloudCostSet(defaultStart, defaultEnd, "aws", "key-1"),
 		},
 	}
 	tests := map[string]struct {
-		data      map[string]map[time.Time]*kubecost.CloudCostSet
+		data      map[string]map[time.Time]*opencost.CloudCostSet
 		startTime time.Time
 		key       string
-		want      *kubecost.CloudCostSet
+		want      *opencost.CloudCostSet
 		wantErr   bool
 	}{
 		"No Data": {
-			data:      map[string]map[time.Time]*kubecost.CloudCostSet{},
+			data:      map[string]map[time.Time]*opencost.CloudCostSet{},
 			startTime: defaultStart,
 			key:       "key-1",
 			want:      nil,
@@ -74,20 +74,20 @@ func TestMemoryRepository_Get(t *testing.T) {
 func TestMemoryRepository_Has(t *testing.T) {
 	defaultStart := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC)
 	defaultEnd := defaultStart.Add(timeutil.Day)
-	defaultData := map[string]map[time.Time]*kubecost.CloudCostSet{
+	defaultData := map[string]map[time.Time]*opencost.CloudCostSet{
 		"key-1": {
 			defaultStart: DefaultMockCloudCostSet(defaultStart, defaultEnd, "aws", "key-1"),
 		},
 	}
 	tests := map[string]struct {
-		data      map[string]map[time.Time]*kubecost.CloudCostSet
+		data      map[string]map[time.Time]*opencost.CloudCostSet
 		startTime time.Time
 		key       string
 		want      bool
 		wantErr   bool
 	}{
 		"No Data": {
-			data:      map[string]map[time.Time]*kubecost.CloudCostSet{},
+			data:      map[string]map[time.Time]*opencost.CloudCostSet{},
 			startTime: defaultStart,
 			key:       "key-1",
 			want:      false,
@@ -135,24 +135,24 @@ func TestMemoryRepository_Has(t *testing.T) {
 func TestMemoryRepository_Keys(t *testing.T) {
 
 	tests := map[string]struct {
-		data    map[string]map[time.Time]*kubecost.CloudCostSet
+		data    map[string]map[time.Time]*opencost.CloudCostSet
 		want    []string
 		wantErr bool
 	}{
 		"empty": {
-			data:    map[string]map[time.Time]*kubecost.CloudCostSet{},
+			data:    map[string]map[time.Time]*opencost.CloudCostSet{},
 			want:    []string{},
 			wantErr: false,
 		},
 		"one-key": {
-			data: map[string]map[time.Time]*kubecost.CloudCostSet{
+			data: map[string]map[time.Time]*opencost.CloudCostSet{
 				"key-1": nil,
 			},
 			want:    []string{"key-1"},
 			wantErr: false,
 		},
 		"two-key": {
-			data: map[string]map[time.Time]*kubecost.CloudCostSet{
+			data: map[string]map[time.Time]*opencost.CloudCostSet{
 				"key-1": nil,
 				"key-2": {
 					time.Now():        nil,
@@ -187,42 +187,42 @@ func TestMemoryRepository_Put(t *testing.T) {
 	defaultEnd := defaultStart.Add(timeutil.Day)
 
 	tests := map[string]struct {
-		data    map[string]map[time.Time]*kubecost.CloudCostSet
-		input   *kubecost.CloudCostSet
-		want    map[string]map[time.Time]*kubecost.CloudCostSet
+		data    map[string]map[time.Time]*opencost.CloudCostSet
+		input   *opencost.CloudCostSet
+		want    map[string]map[time.Time]*opencost.CloudCostSet
 		wantErr bool
 	}{
 
 		"nil set": {
-			data:    map[string]map[time.Time]*kubecost.CloudCostSet{},
+			data:    map[string]map[time.Time]*opencost.CloudCostSet{},
 			input:   nil,
-			want:    map[string]map[time.Time]*kubecost.CloudCostSet{},
+			want:    map[string]map[time.Time]*opencost.CloudCostSet{},
 			wantErr: true,
 		},
 		"invalid window": {
-			data: map[string]map[time.Time]*kubecost.CloudCostSet{},
-			input: &kubecost.CloudCostSet{
+			data: map[string]map[time.Time]*opencost.CloudCostSet{},
+			input: &opencost.CloudCostSet{
 				CloudCosts:  nil,
-				Window:      kubecost.Window{},
+				Window:      opencost.Window{},
 				Integration: "key-1",
 			},
-			want:    map[string]map[time.Time]*kubecost.CloudCostSet{},
+			want:    map[string]map[time.Time]*opencost.CloudCostSet{},
 			wantErr: true,
 		},
 		"invalid key": {
-			data: map[string]map[time.Time]*kubecost.CloudCostSet{},
-			input: &kubecost.CloudCostSet{
+			data: map[string]map[time.Time]*opencost.CloudCostSet{},
+			input: &opencost.CloudCostSet{
 				CloudCosts:  nil,
-				Window:      kubecost.NewClosedWindow(defaultStart, defaultEnd),
+				Window:      opencost.NewClosedWindow(defaultStart, defaultEnd),
 				Integration: "",
 			},
-			want:    map[string]map[time.Time]*kubecost.CloudCostSet{},
+			want:    map[string]map[time.Time]*opencost.CloudCostSet{},
 			wantErr: true,
 		},
 		"valid input": {
-			data:  map[string]map[time.Time]*kubecost.CloudCostSet{},
+			data:  map[string]map[time.Time]*opencost.CloudCostSet{},
 			input: DefaultMockCloudCostSet(defaultStart, defaultEnd, "aws", "key-1"),
-			want: map[string]map[time.Time]*kubecost.CloudCostSet{
+			want: map[string]map[time.Time]*opencost.CloudCostSet{
 				"key-1": {
 					defaultStart: DefaultMockCloudCostSet(defaultStart, defaultEnd, "aws", "key-1"),
 				},
@@ -230,13 +230,13 @@ func TestMemoryRepository_Put(t *testing.T) {
 			wantErr: false,
 		},
 		"overwrite": {
-			data: map[string]map[time.Time]*kubecost.CloudCostSet{
+			data: map[string]map[time.Time]*opencost.CloudCostSet{
 				"key-1": {
 					defaultStart: DefaultMockCloudCostSet(defaultStart, defaultEnd, "gcp", "key-1"),
 				},
 			},
 			input: DefaultMockCloudCostSet(defaultStart, defaultEnd, "aws", "key-1"),
-			want: map[string]map[time.Time]*kubecost.CloudCostSet{
+			want: map[string]map[time.Time]*opencost.CloudCostSet{
 				"key-1": {
 					defaultStart: DefaultMockCloudCostSet(defaultStart, defaultEnd, "aws", "key-1"),
 				},
@@ -244,16 +244,16 @@ func TestMemoryRepository_Put(t *testing.T) {
 			wantErr: false,
 		},
 		"invalid overwrite": {
-			data: map[string]map[time.Time]*kubecost.CloudCostSet{
+			data: map[string]map[time.Time]*opencost.CloudCostSet{
 				"key-1": {
 					defaultStart: DefaultMockCloudCostSet(defaultStart, defaultEnd, "gcp", "key-1"),
 				},
 			},
-			input: &kubecost.CloudCostSet{
-				Window:      kubecost.NewWindow(&defaultStart, nil),
+			input: &opencost.CloudCostSet{
+				Window:      opencost.NewWindow(&defaultStart, nil),
 				Integration: "key-1",
 			},
-			want: map[string]map[time.Time]*kubecost.CloudCostSet{
+			want: map[string]map[time.Time]*opencost.CloudCostSet{
 				"key-1": {
 					defaultStart: DefaultMockCloudCostSet(defaultStart, defaultEnd, "gcp", "key-1"),
 				},
@@ -281,19 +281,19 @@ func TestMemoryRepository_Expire(t *testing.T) {
 	dayTwo := time.Date(2023, 1, 2, 0, 0, 0, 0, time.UTC)
 	dayThree := time.Date(2023, 1, 3, 0, 0, 0, 0, time.UTC)
 	tests := map[string]struct {
-		data    map[string]map[time.Time]*kubecost.CloudCostSet
+		data    map[string]map[time.Time]*opencost.CloudCostSet
 		limit   time.Time
-		want    map[string]map[time.Time]*kubecost.CloudCostSet
+		want    map[string]map[time.Time]*opencost.CloudCostSet
 		wantErr bool
 	}{
 		"no expire": {
-			data: map[string]map[time.Time]*kubecost.CloudCostSet{
+			data: map[string]map[time.Time]*opencost.CloudCostSet{
 				"key-1": {
 					dayTwo: nil,
 				},
 			},
 			limit: dayOne,
-			want: map[string]map[time.Time]*kubecost.CloudCostSet{
+			want: map[string]map[time.Time]*opencost.CloudCostSet{
 				"key-1": {
 					dayTwo: nil,
 				},
@@ -301,13 +301,13 @@ func TestMemoryRepository_Expire(t *testing.T) {
 			wantErr: false,
 		},
 		"limit match": {
-			data: map[string]map[time.Time]*kubecost.CloudCostSet{
+			data: map[string]map[time.Time]*opencost.CloudCostSet{
 				"key-1": {
 					dayTwo: nil,
 				},
 			},
 			limit: dayTwo,
-			want: map[string]map[time.Time]*kubecost.CloudCostSet{
+			want: map[string]map[time.Time]*opencost.CloudCostSet{
 				"key-1": {
 					dayTwo: nil,
 				},
@@ -315,17 +315,17 @@ func TestMemoryRepository_Expire(t *testing.T) {
 			wantErr: false,
 		},
 		"single expire": {
-			data: map[string]map[time.Time]*kubecost.CloudCostSet{
+			data: map[string]map[time.Time]*opencost.CloudCostSet{
 				"key-1": {
 					dayTwo: nil,
 				},
 			},
 			limit:   dayThree,
-			want:    map[string]map[time.Time]*kubecost.CloudCostSet{},
+			want:    map[string]map[time.Time]*opencost.CloudCostSet{},
 			wantErr: false,
 		},
 		"one key expire": {
-			data: map[string]map[time.Time]*kubecost.CloudCostSet{
+			data: map[string]map[time.Time]*opencost.CloudCostSet{
 				"key-1": {
 					dayOne: nil,
 					dayTwo: nil,
@@ -335,7 +335,7 @@ func TestMemoryRepository_Expire(t *testing.T) {
 				},
 			},
 			limit: dayTwo,
-			want: map[string]map[time.Time]*kubecost.CloudCostSet{
+			want: map[string]map[time.Time]*opencost.CloudCostSet{
 				"key-1": {
 					dayTwo: nil,
 				},

+ 21 - 21
pkg/cloudcost/mock.go

@@ -3,84 +3,84 @@ package cloudcost
 import (
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 )
 
-func DefaultMockCloudCostSet(start, end time.Time, provider, integration string) *kubecost.CloudCostSet {
-	ccs := kubecost.NewCloudCostSet(start, end)
+func DefaultMockCloudCostSet(start, end time.Time, provider, integration string) *opencost.CloudCostSet {
+	ccs := opencost.NewCloudCostSet(start, end)
 
 	ccs.Integration = integration
 
-	ccs.Insert(&kubecost.CloudCost{
+	ccs.Insert(&opencost.CloudCost{
 		Window: ccs.Window,
-		Properties: &kubecost.CloudCostProperties{
+		Properties: &opencost.CloudCostProperties{
 			Provider:        provider,
 			AccountID:       "account1",
 			InvoiceEntityID: "invoiceEntity1",
 			Service:         provider + "-storage",
-			Category:        kubecost.StorageCategory,
-			Labels: kubecost.CloudCostLabels{
+			Category:        opencost.StorageCategory,
+			Labels: opencost.CloudCostLabels{
 				"label1": "value1",
 				"label2": "value2",
 				"label3": "value3",
 			},
 			ProviderID: "id1",
 		},
-		ListCost: kubecost.CostMetric{
+		ListCost: opencost.CostMetric{
 			Cost:              100,
 			KubernetesPercent: 0,
 		},
-		NetCost: kubecost.CostMetric{
+		NetCost: opencost.CostMetric{
 			Cost:              100,
 			KubernetesPercent: 0,
 		},
 	})
 
-	ccs.Insert(&kubecost.CloudCost{
+	ccs.Insert(&opencost.CloudCost{
 		Window: ccs.Window,
-		Properties: &kubecost.CloudCostProperties{
+		Properties: &opencost.CloudCostProperties{
 			Provider:        provider,
 			AccountID:       "account1",
 			InvoiceEntityID: "invoiceEntity1",
 			Service:         provider + "-compute",
-			Category:        kubecost.ComputeCategory,
-			Labels: kubecost.CloudCostLabels{
+			Category:        opencost.ComputeCategory,
+			Labels: opencost.CloudCostLabels{
 				"label1": "value1",
 				"label2": "value2",
 				"label3": "value3",
 			},
 			ProviderID: "id2",
 		},
-		ListCost: kubecost.CostMetric{
+		ListCost: opencost.CostMetric{
 			Cost:              2000,
 			KubernetesPercent: 1,
 		},
-		NetCost: kubecost.CostMetric{
+		NetCost: opencost.CostMetric{
 			Cost:              1800,
 			KubernetesPercent: 1,
 		},
 	})
 
-	ccs.Insert(&kubecost.CloudCost{
+	ccs.Insert(&opencost.CloudCost{
 		Window: ccs.Window,
-		Properties: &kubecost.CloudCostProperties{
+		Properties: &opencost.CloudCostProperties{
 			Provider:        provider,
 			AccountID:       "account2",
 			InvoiceEntityID: "invoiceEntity2",
 			Service:         provider + "-compute",
-			Category:        kubecost.ComputeCategory,
-			Labels: kubecost.CloudCostLabels{
+			Category:        opencost.ComputeCategory,
+			Labels: opencost.CloudCostLabels{
 				"label1": "value1",
 				"label2": "value2",
 				"label3": "value3",
 			},
 			ProviderID: "id3",
 		},
-		ListCost: kubecost.CostMetric{
+		ListCost: opencost.CostMetric{
 			Cost:              8000,
 			KubernetesPercent: 1,
 		},
-		NetCost: kubecost.CostMetric{
+		NetCost: opencost.CostMetric{
 			Cost:              8000,
 			KubernetesPercent: 1,
 		},

+ 3 - 3
pkg/cloudcost/pipelineservice.go

@@ -6,7 +6,7 @@ import (
 	"time"
 
 	"github.com/julienschmidt/httprouter"
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	proto "github.com/opencost/opencost/core/pkg/protocol"
 	cloudconfig "github.com/opencost/opencost/pkg/cloud"
 	"github.com/opencost/opencost/pkg/cloud/config"
@@ -138,9 +138,9 @@ func (s *PipelineService) GetCloudCostRepairHandler() func(w http.ResponseWriter
 
 		windowStr := r.URL.Query().Get("window")
 
-		var window kubecost.Window
+		var window opencost.Window
 		if windowStr != "" {
-			win, err := kubecost.ParseWindowWithOffset(windowStr, env.GetParsedUTCOffset())
+			win, err := opencost.ParseWindowWithOffset(windowStr, env.GetParsedUTCOffset())
 			if err != nil {
 				http.Error(w, fmt.Sprintf("Invalid parameter: %s", err), http.StatusBadRequest)
 				return

+ 4 - 4
pkg/cloudcost/querier.go

@@ -7,19 +7,19 @@ import (
 	"time"
 
 	"github.com/opencost/opencost/core/pkg/filter"
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 )
 
 // Querier allows for querying ranges of CloudCost data
 type Querier interface {
-	Query(QueryRequest, context.Context) (*kubecost.CloudCostSetRange, error)
+	Query(QueryRequest, context.Context) (*opencost.CloudCostSetRange, error)
 }
 
 type QueryRequest struct {
 	Start       time.Time
 	End         time.Time
 	AggregateBy []string
-	Accumulate  kubecost.AccumulateOption
+	Accumulate  opencost.AccumulateOption
 	Filter      filter.Filter
 }
 
@@ -35,7 +35,7 @@ type ViewQuerier interface {
 
 type ViewQueryRequest struct {
 	QueryRequest
-	CostMetricName   kubecost.CostMetricName
+	CostMetricName   opencost.CostMetricName
 	ChartItemsLength int
 	Offset           int
 	Limit            int

+ 2 - 2
pkg/cloudcost/queryservice.go

@@ -6,7 +6,7 @@ import (
 	"strings"
 
 	"github.com/julienschmidt/httprouter"
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/httputil"
 	"go.opentelemetry.io/otel"
 )
@@ -187,7 +187,7 @@ func (s *QueryService) GetCloudCostViewTableHandler() func(w http.ResponseWriter
 		_, spanResp := tracer.Start(ctx, "write response")
 		defer spanResp.End()
 		if format == csvFormat {
-			window := kubecost.NewClosedWindow(request.Start, request.End)
+			window := opencost.NewClosedWindow(request.Start, request.End)
 			writeCloudCostViewTableRowsAsCSV(w, resp, window.String())
 			return
 		}

+ 17 - 17
pkg/cloudcost/queryservice_helper.go

@@ -8,7 +8,7 @@ import (
 
 	"github.com/opencost/opencost/core/pkg/filter"
 	"github.com/opencost/opencost/core/pkg/filter/cloudcost"
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/httputil"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
 )
@@ -20,7 +20,7 @@ func ParseCloudCostRequest(qp httputil.QueryParams) (*QueryRequest, error) {
 		return nil, fmt.Errorf("missing require window param")
 	}
 
-	window, err := kubecost.ParseWindowUTC(windowStr)
+	window, err := opencost.ParseWindowUTC(windowStr)
 	if err != nil {
 		return nil, fmt.Errorf("invalid window parameter: %w", err)
 	}
@@ -40,10 +40,10 @@ func ParseCloudCostRequest(qp httputil.QueryParams) (*QueryRequest, error) {
 
 	// if we're aggregating by nothing (aka `item` on the frontend) then aggregate by all
 	if len(aggregateBy) == 0 {
-		aggregateBy = []string{kubecost.CloudCostInvoiceEntityIDProp, kubecost.CloudCostAccountIDProp, kubecost.CloudCostProviderProp, kubecost.CloudCostProviderIDProp, kubecost.CloudCostCategoryProp, kubecost.CloudCostServiceProp}
+		aggregateBy = []string{opencost.CloudCostInvoiceEntityIDProp, opencost.CloudCostAccountIDProp, opencost.CloudCostProviderProp, opencost.CloudCostProviderIDProp, opencost.CloudCostCategoryProp, opencost.CloudCostServiceProp}
 	}
 
-	accumulate := kubecost.ParseAccumulate(qp.Get("accumulate", ""))
+	accumulate := opencost.ParseAccumulate(qp.Get("accumulate", ""))
 
 	var filter filter.Filter
 	filterString := qp.Get("filter", "")
@@ -68,18 +68,18 @@ func ParseCloudCostRequest(qp httputil.QueryParams) (*QueryRequest, error) {
 
 func ParseCloudCostProperty(text string) (string, error) {
 	switch strings.TrimSpace(strings.ToLower(text)) {
-	case strings.ToLower(kubecost.CloudCostInvoiceEntityIDProp):
-		return kubecost.CloudCostInvoiceEntityIDProp, nil
-	case strings.ToLower(kubecost.CloudCostAccountIDProp):
-		return kubecost.CloudCostAccountIDProp, nil
-	case strings.ToLower(kubecost.CloudCostProviderProp):
-		return kubecost.CloudCostProviderProp, nil
-	case strings.ToLower(kubecost.CloudCostProviderIDProp):
-		return kubecost.CloudCostProviderIDProp, nil
-	case strings.ToLower(kubecost.CloudCostCategoryProp):
-		return kubecost.CloudCostCategoryProp, nil
-	case strings.ToLower(kubecost.CloudCostServiceProp):
-		return kubecost.CloudCostServiceProp, nil
+	case strings.ToLower(opencost.CloudCostInvoiceEntityIDProp):
+		return opencost.CloudCostInvoiceEntityIDProp, nil
+	case strings.ToLower(opencost.CloudCostAccountIDProp):
+		return opencost.CloudCostAccountIDProp, nil
+	case strings.ToLower(opencost.CloudCostProviderProp):
+		return opencost.CloudCostProviderProp, nil
+	case strings.ToLower(opencost.CloudCostProviderIDProp):
+		return opencost.CloudCostProviderIDProp, nil
+	case strings.ToLower(opencost.CloudCostCategoryProp):
+		return opencost.CloudCostCategoryProp, nil
+	case strings.ToLower(opencost.CloudCostServiceProp):
+		return opencost.CloudCostServiceProp, nil
 	}
 
 	if strings.HasPrefix(text, "label:") {
@@ -97,7 +97,7 @@ func parseCloudCostViewRequest(qp httputil.QueryParams) (*ViewQueryRequest, erro
 	}
 
 	// parse cost metric
-	costMetricName, err := kubecost.ParseCostMetricName(qp.Get("costMetric", string(kubecost.CostMetricAmortizedNetCost)))
+	costMetricName, err := opencost.ParseCostMetricName(qp.Get("costMetric", string(opencost.CostMetricAmortizedNetCost)))
 	if err != nil {
 		return nil, fmt.Errorf("error parsing 'costMetric': %w", err)
 	}

+ 9 - 9
pkg/cloudcost/queryservice_helper_test.go

@@ -6,7 +6,7 @@ import (
 	"time"
 
 	"github.com/opencost/opencost/core/pkg/filter/cloudcost"
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/httputil"
 )
 
@@ -41,7 +41,7 @@ func TestParseCloudCostRequest(t *testing.T) {
 			want: &QueryRequest{
 				Start:       start,
 				End:         end,
-				AggregateBy: []string{kubecost.CloudCostInvoiceEntityIDProp, kubecost.CloudCostAccountIDProp, kubecost.CloudCostProviderProp, kubecost.CloudCostProviderIDProp, kubecost.CloudCostCategoryProp, kubecost.CloudCostServiceProp},
+				AggregateBy: []string{opencost.CloudCostInvoiceEntityIDProp, opencost.CloudCostAccountIDProp, opencost.CloudCostProviderProp, opencost.CloudCostProviderIDProp, opencost.CloudCostCategoryProp, opencost.CloudCostServiceProp},
 				Accumulate:  "",
 				Filter:      nil,
 			},
@@ -55,7 +55,7 @@ func TestParseCloudCostRequest(t *testing.T) {
 			want: &QueryRequest{
 				Start:       start,
 				End:         end,
-				AggregateBy: []string{kubecost.CloudCostInvoiceEntityIDProp, kubecost.CloudCostAccountIDProp, "label:app"},
+				AggregateBy: []string{opencost.CloudCostInvoiceEntityIDProp, opencost.CloudCostAccountIDProp, "label:app"},
 				Accumulate:  "",
 				Filter:      nil,
 			},
@@ -77,8 +77,8 @@ func TestParseCloudCostRequest(t *testing.T) {
 			want: &QueryRequest{
 				Start:       start,
 				End:         end,
-				AggregateBy: []string{kubecost.CloudCostInvoiceEntityIDProp, kubecost.CloudCostAccountIDProp, kubecost.CloudCostProviderProp, kubecost.CloudCostProviderIDProp, kubecost.CloudCostCategoryProp, kubecost.CloudCostServiceProp},
-				Accumulate:  kubecost.AccumulateOptionWeek,
+				AggregateBy: []string{opencost.CloudCostInvoiceEntityIDProp, opencost.CloudCostAccountIDProp, opencost.CloudCostProviderProp, opencost.CloudCostProviderIDProp, opencost.CloudCostCategoryProp, opencost.CloudCostServiceProp},
+				Accumulate:  opencost.AccumulateOptionWeek,
 				Filter:      nil,
 			},
 			wantErr: false,
@@ -91,8 +91,8 @@ func TestParseCloudCostRequest(t *testing.T) {
 			want: &QueryRequest{
 				Start:       start,
 				End:         end,
-				AggregateBy: []string{kubecost.CloudCostInvoiceEntityIDProp, kubecost.CloudCostAccountIDProp, kubecost.CloudCostProviderProp, kubecost.CloudCostProviderIDProp, kubecost.CloudCostCategoryProp, kubecost.CloudCostServiceProp},
-				Accumulate:  kubecost.AccumulateOptionNone,
+				AggregateBy: []string{opencost.CloudCostInvoiceEntityIDProp, opencost.CloudCostAccountIDProp, opencost.CloudCostProviderProp, opencost.CloudCostProviderIDProp, opencost.CloudCostCategoryProp, opencost.CloudCostServiceProp},
+				Accumulate:  opencost.AccumulateOptionNone,
 				Filter:      nil,
 			},
 			wantErr: false,
@@ -105,8 +105,8 @@ func TestParseCloudCostRequest(t *testing.T) {
 			want: &QueryRequest{
 				Start:       start,
 				End:         end,
-				AggregateBy: []string{kubecost.CloudCostInvoiceEntityIDProp, kubecost.CloudCostAccountIDProp, kubecost.CloudCostProviderProp, kubecost.CloudCostProviderIDProp, kubecost.CloudCostCategoryProp, kubecost.CloudCostServiceProp},
-				Accumulate:  kubecost.AccumulateOptionNone,
+				AggregateBy: []string{opencost.CloudCostInvoiceEntityIDProp, opencost.CloudCostAccountIDProp, opencost.CloudCostProviderProp, opencost.CloudCostProviderIDProp, opencost.CloudCostCategoryProp, opencost.CloudCostServiceProp},
+				Accumulate:  opencost.AccumulateOptionNone,
 				Filter:      validFilter,
 			},
 			wantErr: false,

+ 3 - 3
pkg/cloudcost/repository.go

@@ -3,14 +3,14 @@ package cloudcost
 import (
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 )
 
 // Repository is an interface for storing and retrieving CloudCost data
 type Repository interface {
 	Has(time.Time, string) (bool, error)
-	Get(time.Time, string) (*kubecost.CloudCostSet, error)
+	Get(time.Time, string) (*opencost.CloudCostSet, error)
 	Keys() ([]string, error)
-	Put(*kubecost.CloudCostSet) error
+	Put(*opencost.CloudCostSet) error
 	Expire(time.Time) error
 }

+ 5 - 5
pkg/cloudcost/repositoryquerier.go

@@ -5,8 +5,8 @@ import (
 	"fmt"
 	"sort"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 )
 
 // RepositoryQuerier is an implementation of Querier and ViewQuerier which pulls directly from a Repository
@@ -18,21 +18,21 @@ func NewRepositoryQuerier(repo Repository) *RepositoryQuerier {
 	return &RepositoryQuerier{repo: repo}
 }
 
-func (rq *RepositoryQuerier) Query(request QueryRequest, ctx context.Context) (*kubecost.CloudCostSetRange, error) {
+func (rq *RepositoryQuerier) Query(request QueryRequest, ctx context.Context) (*opencost.CloudCostSetRange, error) {
 	repoKeys, err := rq.repo.Keys()
 	if err != nil {
 		return nil, fmt.Errorf("RepositoryQuerier: Query: failed to get list of keys from repository: %w", err)
 	}
 
 	// create filter
-	compiler := kubecost.NewCloudCostMatchCompiler()
+	compiler := opencost.NewCloudCostMatchCompiler()
 	matcher, err := compiler.Compile(request.Filter)
 	if err != nil {
 		return nil, fmt.Errorf("RepositoryQuerier: Query: failed to compile filters: %w", err)
 	}
 
 	// Create a Cloud Cost Set Range in the resolution of the repository
-	ccsr, err := kubecost.NewCloudCostSetRange(request.Start, request.End, kubecost.AccumulateOptionDay, "")
+	ccsr, err := opencost.NewCloudCostSetRange(request.Start, request.End, opencost.AccumulateOptionDay, "")
 	if err != nil {
 		return nil, fmt.Errorf("RepositoryQuerier: Query: failed to create Cloud Cost Set Range: %w", err)
 	}
@@ -57,7 +57,7 @@ func (rq *RepositoryQuerier) Query(request QueryRequest, ctx context.Context) (*
 		}
 	}
 
-	if request.Accumulate != kubecost.AccumulateOptionNone {
+	if request.Accumulate != opencost.AccumulateOptionNone {
 		ccsr, err = ccsr.Accumulate(request.Accumulate)
 		if err != nil {
 			return nil, fmt.Errorf("RepositoryQuerier: Query: error accumulating: %w", err)

+ 27 - 27
pkg/costmodel/aggregation.go

@@ -15,8 +15,8 @@ import (
 	"github.com/patrickmn/go-cache"
 	prometheusClient "github.com/prometheus/client_golang/api"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util"
 	"github.com/opencost/opencost/core/pkg/util/httputil"
 	"github.com/opencost/opencost/core/pkg/util/json"
@@ -50,7 +50,7 @@ type Aggregation struct {
 	Subfields                  []string                       `json:"subfields,omitempty"`
 	Environment                string                         `json:"environment"`
 	Cluster                    string                         `json:"cluster,omitempty"`
-	Properties                 *kubecost.AllocationProperties `json:"-"`
+	Properties                 *opencost.AllocationProperties `json:"-"`
 	Start                      time.Time                      `json:"-"`
 	End                        time.Time                      `json:"-"`
 	CPUAllocationHourlyAverage float64                        `json:"cpuAllocationAverage"`
@@ -597,7 +597,7 @@ func aggregateDatum(cp models.Provider, aggregations map[string]*Aggregation, co
 			agg.Subfields = subfields
 		}
 		if includeProperties {
-			props := &kubecost.AllocationProperties{}
+			props := &opencost.AllocationProperties{}
 			props.Cluster = costDatum.ClusterID
 			props.Node = costDatum.NodeName
 			if controller, kind, hasController := costDatum.GetController(); hasController {
@@ -908,7 +908,7 @@ const minCostDataLength = 2
 // defined interval
 type EmptyDataError struct {
 	err    error
-	window kubecost.Window
+	window opencost.Window
 }
 
 // Error implements the error interface
@@ -1051,7 +1051,7 @@ func DefaultAggregateQueryOpts() *AggregateQueryOpts {
 
 // ComputeAggregateCostModel computes cost data for the given window, then aggregates it by the given fields.
 // Data is cached on two levels: the aggregation is cached as well as the underlying cost data.
-func (a *Accesses) ComputeAggregateCostModel(promClient prometheusClient.Client, window kubecost.Window, field string, subfields []string, opts *AggregateQueryOpts) (map[string]*Aggregation, string, error) {
+func (a *Accesses) ComputeAggregateCostModel(promClient prometheusClient.Client, window opencost.Window, field string, subfields []string, opts *AggregateQueryOpts) (map[string]*Aggregation, string, error) {
 	// Window is the range of the query, i.e. (start, end)
 	// It must be closed, i.e. neither start nor end can be nil
 	if window.IsOpen() {
@@ -1620,7 +1620,7 @@ type aggKeyParams struct {
 }
 
 // GenerateAggKey generates a parameter-unique key for caching the aggregate cost model
-func GenerateAggKey(window kubecost.Window, field string, subfields []string, opts *AggregateQueryOpts) string {
+func GenerateAggKey(window opencost.Window, field string, subfields []string, opts *AggregateQueryOpts) string {
 	if opts == nil {
 		opts = DefaultAggregateQueryOpts()
 	}
@@ -1729,7 +1729,7 @@ func GenerateAggKey(window kubecost.Window, field string, subfields []string, op
 // a brutal interface, which should be cleaned up, but it's necessary for
 // being able to swap in an ETL-backed implementation.
 type Aggregator interface {
-	ComputeAggregateCostModel(promClient prometheusClient.Client, window kubecost.Window, field string, subfields []string, opts *AggregateQueryOpts) (map[string]*Aggregation, string, error)
+	ComputeAggregateCostModel(promClient prometheusClient.Client, window opencost.Window, field string, subfields []string, opts *AggregateQueryOpts) (map[string]*Aggregation, string, error)
 }
 
 func (a *Accesses) warmAggregateCostModelCache() {
@@ -1750,7 +1750,7 @@ func (a *Accesses) warmAggregateCostModelCache() {
 		promClient := a.GetPrometheusClient(true)
 
 		windowStr := fmt.Sprintf("%s offset %s", fmtDuration, fmtOffset)
-		window, err := kubecost.ParseWindowUTC(windowStr)
+		window, err := opencost.ParseWindowUTC(windowStr)
 		if err != nil {
 			return nil, fmt.Errorf("invalid window from window string: %s", windowStr)
 		}
@@ -1914,7 +1914,7 @@ func (a *Accesses) AggregateCostModelHandler(w http.ResponseWriter, r *http.Requ
 	}
 
 	// determine duration and offset from query parameters
-	window, err := kubecost.ParseWindowWithOffset(windowStr, env.GetParsedUTCOffset())
+	window, err := opencost.ParseWindowWithOffset(windowStr, env.GetParsedUTCOffset())
 	if err != nil || window.Start() == nil {
 		WriteError(w, BadRequest(fmt.Sprintf("invalid window: %s", err)))
 		return
@@ -2077,7 +2077,7 @@ func (a *Accesses) AggregateCostModelHandler(w http.ResponseWriter, r *http.Requ
 			}
 			return
 		}
-		if boundaryErr, ok := err.(*kubecost.BoundaryError); ok {
+		if boundaryErr, ok := err.(*opencost.BoundaryError); ok {
 			if window.Start() != nil && window.Start().After(time.Now().Add(-90*24*time.Hour)) {
 				// Asking for data within a 90 day period: it will be available
 				// after the pipeline builds
@@ -2118,11 +2118,11 @@ func ParseAggregationProperties(aggregations []string) ([]string, error) {
 	// In case of no aggregation option, aggregate to the container, with a key Cluster/Node/Namespace/Pod/Container
 	if len(aggregations) == 0 {
 		aggregateBy = []string{
-			kubecost.AllocationClusterProp,
-			kubecost.AllocationNodeProp,
-			kubecost.AllocationNamespaceProp,
-			kubecost.AllocationPodProp,
-			kubecost.AllocationContainerProp,
+			opencost.AllocationClusterProp,
+			opencost.AllocationNodeProp,
+			opencost.AllocationNamespaceProp,
+			opencost.AllocationPodProp,
+			opencost.AllocationContainerProp,
 		}
 	} else if len(aggregations) == 1 && aggregations[0] == "all" {
 		aggregateBy = []string{}
@@ -2130,7 +2130,7 @@ func ParseAggregationProperties(aggregations []string) ([]string, error) {
 		for _, agg := range aggregations {
 			aggregate := strings.TrimSpace(agg)
 			if aggregate != "" {
-				if prop, err := kubecost.ParseProperty(aggregate); err == nil {
+				if prop, err := opencost.ParseProperty(aggregate); err == nil {
 					aggregateBy = append(aggregateBy, string(prop))
 				} else if strings.HasPrefix(aggregate, "label:") {
 					aggregateBy = append(aggregateBy, aggregate)
@@ -2150,7 +2150,7 @@ func (a *Accesses) ComputeAllocationHandlerSummary(w http.ResponseWriter, r *htt
 
 	// Window is a required field describing the window of time over which to
 	// compute allocation data.
-	window, err := kubecost.ParseWindowWithOffset(qp.Get("window", ""), env.GetParsedUTCOffset())
+	window, err := opencost.ParseWindowWithOffset(qp.Get("window", ""), env.GetParsedUTCOffset())
 	if err != nil {
 		http.Error(w, fmt.Sprintf("Invalid 'window' parameter: %s", err), http.StatusBadRequest)
 	}
@@ -2180,11 +2180,11 @@ func (a *Accesses) ComputeAllocationHandlerSummary(w http.ResponseWriter, r *htt
 
 	// Query for AllocationSets in increments of the given step duration,
 	// appending each to the AllocationSetRange.
-	asr := kubecost.NewAllocationSetRange()
+	asr := opencost.NewAllocationSetRange()
 	stepStart := *window.Start()
 	for window.End().After(stepStart) {
 		stepEnd := stepStart.Add(step)
-		stepWindow := kubecost.NewWindow(&stepStart, &stepEnd)
+		stepWindow := opencost.NewWindow(&stepStart, &stepEnd)
 
 		as, err := a.Model.ComputeAllocation(*stepWindow.Start(), *stepWindow.End(), resolution)
 		if err != nil {
@@ -2207,19 +2207,19 @@ func (a *Accesses) ComputeAllocationHandlerSummary(w http.ResponseWriter, r *htt
 
 	// Accumulate, if requested
 	if accumulate {
-		asr, err = asr.Accumulate(kubecost.AccumulateOptionAll)
+		asr, err = asr.Accumulate(opencost.AccumulateOptionAll)
 		if err != nil {
 			WriteError(w, InternalServerError(err.Error()))
 			return
 		}
 	}
 
-	sasl := []*kubecost.SummaryAllocationSet{}
+	sasl := []*opencost.SummaryAllocationSet{}
 	for _, as := range asr.Slice() {
-		sas := kubecost.NewSummaryAllocationSet(as, nil, nil, false, false)
+		sas := opencost.NewSummaryAllocationSet(as, nil, nil, false, false)
 		sasl = append(sasl, sas)
 	}
-	sasr := kubecost.NewSummaryAllocationSetRange(sasl...)
+	sasr := opencost.NewSummaryAllocationSetRange(sasl...)
 
 	w.Write(WrapData(sasr, nil))
 }
@@ -2232,7 +2232,7 @@ func (a *Accesses) ComputeAllocationHandler(w http.ResponseWriter, r *http.Reque
 
 	// Window is a required field describing the window of time over which to
 	// compute allocation data.
-	window, err := kubecost.ParseWindowWithOffset(qp.Get("window", ""), env.GetParsedUTCOffset())
+	window, err := opencost.ParseWindowWithOffset(qp.Get("window", ""), env.GetParsedUTCOffset())
 	if err != nil {
 		http.Error(w, fmt.Sprintf("Invalid 'window' parameter: %s", err), http.StatusBadRequest)
 	}
@@ -2265,11 +2265,11 @@ func (a *Accesses) ComputeAllocationHandler(w http.ResponseWriter, r *http.Reque
 	// Accumulate is an optional parameter that accumulates an AllocationSetRange
 	// by the resolution of the given time duration.
 	// Defaults to 0. If a value is not passed then the parameter is not used.
-	accumulateBy := kubecost.AccumulateOption(qp.Get("accumulateBy", ""))
+	accumulateBy := opencost.AccumulateOption(qp.Get("accumulateBy", ""))
 
 	// if accumulateBy is not explicitly set, and accumulate is true, ensure result is accumulated
-	if accumulateBy == kubecost.AccumulateOptionNone && accumulate {
-		accumulateBy = kubecost.AccumulateOptionAll
+	if accumulateBy == opencost.AccumulateOptionNone && accumulate {
+		accumulateBy = opencost.AccumulateOptionAll
 	}
 
 	// IdleByNode, if true, computes idle allocations at the node level.

+ 6 - 6
pkg/costmodel/aggregation_test.go

@@ -3,7 +3,7 @@ package costmodel
 import (
 	"testing"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util"
 )
 
@@ -198,11 +198,11 @@ func TestScaleHourlyCostData(t *testing.T) {
 func TestParseAggregationProperties_Default(t *testing.T) {
 	got, err := ParseAggregationProperties([]string{})
 	expected := []string{
-		kubecost.AllocationClusterProp,
-		kubecost.AllocationNodeProp,
-		kubecost.AllocationNamespaceProp,
-		kubecost.AllocationPodProp,
-		kubecost.AllocationContainerProp,
+		opencost.AllocationClusterProp,
+		opencost.AllocationNodeProp,
+		opencost.AllocationNamespaceProp,
+		opencost.AllocationPodProp,
+		opencost.AllocationContainerProp,
 	}
 
 	if err != nil {

+ 15 - 15
pkg/costmodel/allocation.go

@@ -4,16 +4,16 @@ import (
 	"fmt"
 	"time"
 
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/timeutil"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
 	"github.com/opencost/opencost/pkg/env"
 	"github.com/opencost/opencost/pkg/prom"
 )
 
 const (
-	// https://kubecost.atlassian.net/browse/BURNDOWN-234
+	// https://opencost.atlassian.net/browse/BURNDOWN-234
 	// upstream KSM has implementation change vs OC internal KSM - it sets metric to 0 when pod goes down
 	// VS OC implementation which stops emitting it
 	// by adding != 0 filter, we keep just the active times in the prom result
@@ -117,7 +117,7 @@ func (cm *CostModel) Name() string {
 // ComputeAllocation uses the CostModel instance to compute an AllocationSet
 // for the window defined by the given start and end times. The Allocations
 // returned are unaggregated (i.e. down to the container level).
-func (cm *CostModel) ComputeAllocation(start, end time.Time, resolution time.Duration) (*kubecost.AllocationSet, error) {
+func (cm *CostModel) ComputeAllocation(start, end time.Time, resolution time.Duration) (*opencost.AllocationSet, error) {
 
 	// If the duration is short enough, compute the AllocationSet directly
 	if end.Sub(start) <= cm.MaxPrometheusQueryDuration {
@@ -134,7 +134,7 @@ func (cm *CostModel) ComputeAllocation(start, end time.Time, resolution time.Dur
 
 	// Collect AllocationSets in a range, then accumulate
 	// TODO optimize by collecting consecutive AllocationSets, accumulating as we go
-	asr := kubecost.NewAllocationSetRange()
+	asr := opencost.NewAllocationSetRange()
 
 	for e.Before(end) {
 		// By default, query for the full remaining duration. But do not let
@@ -151,7 +151,7 @@ func (cm *CostModel) ComputeAllocation(start, end time.Time, resolution time.Dur
 		// Compute the individual AllocationSet for just (s, e)
 		as, _, err := cm.computeAllocation(s, e, resolution)
 		if err != nil {
-			return kubecost.NewAllocationSet(start, end), fmt.Errorf("error computing allocation for %s: %s", kubecost.NewClosedWindow(s, e), err)
+			return opencost.NewAllocationSet(start, end), fmt.Errorf("error computing allocation for %s: %s", opencost.NewClosedWindow(s, e), err)
 		}
 
 		// Append to the range
@@ -210,15 +210,15 @@ func (cm *CostModel) ComputeAllocation(start, end time.Time, resolution time.Dur
 	// Accumulate to yield the result AllocationSet. After this step, we will
 	// be nearly complete, but without the raw allocation data, which must be
 	// recomputed.
-	resultASR, err := asr.Accumulate(kubecost.AccumulateOptionAll)
+	resultASR, err := asr.Accumulate(opencost.AccumulateOptionAll)
 	if err != nil {
-		return kubecost.NewAllocationSet(start, end), fmt.Errorf("error accumulating data for %s: %s", kubecost.NewClosedWindow(s, e), err)
+		return opencost.NewAllocationSet(start, end), fmt.Errorf("error accumulating data for %s: %s", opencost.NewClosedWindow(s, e), err)
 	}
 	if resultASR != nil && len(resultASR.Allocations) == 0 {
-		return kubecost.NewAllocationSet(start, end), nil
+		return opencost.NewAllocationSet(start, end), nil
 	}
 	if length := len(resultASR.Allocations); length != 1 {
-		return kubecost.NewAllocationSet(start, end), fmt.Errorf("expected 1 accumulated allocation set, found %d sets", length)
+		return opencost.NewAllocationSet(start, end), fmt.Errorf("expected 1 accumulated allocation set, found %d sets", length)
 	}
 	result := resultASR.Allocations[0]
 
@@ -256,7 +256,7 @@ func (cm *CostModel) ComputeAllocation(start, end time.Time, resolution time.Dur
 			}
 
 			if resultAlloc.RawAllocationOnly == nil {
-				resultAlloc.RawAllocationOnly = &kubecost.RawAllocationOnlyData{}
+				resultAlloc.RawAllocationOnly = &opencost.RawAllocationOnlyData{}
 			}
 
 			if alloc.RawAllocationOnly == nil {
@@ -318,18 +318,18 @@ func (cm *CostModel) DateRange() (time.Time, time.Time, error) {
 	return oldest, newest, nil
 }
 
-func (cm *CostModel) computeAllocation(start, end time.Time, resolution time.Duration) (*kubecost.AllocationSet, map[nodeKey]*nodePricing, error) {
+func (cm *CostModel) computeAllocation(start, end time.Time, resolution time.Duration) (*opencost.AllocationSet, map[nodeKey]*nodePricing, error) {
 	// 1. Build out Pod map from resolution-tuned, batched Pod start/end query
 	// 2. Run and apply the results of the remaining queries to
 	// 3. Build out AllocationSet from completed Pod map
 
 	// Create a window spanning the requested query
-	window := kubecost.NewWindow(&start, &end)
+	window := opencost.NewWindow(&start, &end)
 
 	// Create an empty AllocationSet. For safety, in the case of an error, we
 	// should prefer to return this empty set with the error. (In the case of
 	// no error, of course we populate the set and return it.)
-	allocSet := kubecost.NewAllocationSet(start, end)
+	allocSet := opencost.NewAllocationSet(start, end)
 
 	// (1) Build out Pod map
 
@@ -375,7 +375,7 @@ func (cm *CostModel) computeAllocation(start, end time.Time, resolution time.Dur
 	// Query for the duration between start and end
 	durStr := timeutil.DurationString(end.Sub(start))
 	if durStr == "" {
-		return allocSet, nil, fmt.Errorf("illegal duration value for %s", kubecost.NewClosedWindow(start, end))
+		return allocSet, nil, fmt.Errorf("illegal duration value for %s", opencost.NewClosedWindow(start, end))
 	}
 
 	// Convert resolution duration to a query-ready string
@@ -650,7 +650,7 @@ func (cm *CostModel) computeAllocation(start, end time.Time, resolution time.Dur
 	applyControllersToPods(podMap, podReplicaSetMap)
 
 	serviceLabels := getServiceLabels(resServiceLabels)
-	allocsByService := map[serviceKey][]*kubecost.Allocation{}
+	allocsByService := map[serviceKey][]*opencost.Allocation{}
 	applyServicesToPods(podMap, podLabels, allocsByService, serviceLabels)
 
 	// TODO breakdown network costs?

+ 43 - 43
pkg/costmodel/allocation_helpers.go

@@ -7,8 +7,8 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
 	"github.com/opencost/opencost/core/pkg/util/timeutil"
 	"github.com/opencost/opencost/pkg/cloud/provider"
@@ -31,7 +31,7 @@ const PV_USAGE_SANITY_LIMIT_BYTES = 10.0 * PiB
 
 /* Pod Helpers */
 
-func (cm *CostModel) buildPodMap(window kubecost.Window, resolution, maxBatchSize time.Duration, podMap map[podKey]*pod, clusterStart, clusterEnd map[string]time.Time, ingestPodUID bool, podUIDKeyMap map[podKey][]podKey) error {
+func (cm *CostModel) buildPodMap(window opencost.Window, resolution, maxBatchSize time.Duration, podMap map[podKey]*pod, clusterStart, clusterEnd map[string]time.Time, ingestPodUID bool, podUIDKeyMap map[podKey][]podKey) error {
 	// Assumes that window is positive and closed
 	start, end := *window.Start(), *window.End()
 
@@ -46,7 +46,7 @@ func (cm *CostModel) buildPodMap(window kubecost.Window, resolution, maxBatchSiz
 	// overall progress by starting with (window.start, window.start) and
 	// querying in batches no larger than maxBatchSize from start-to-end,
 	// folding each result set into podMap as the results come back.
-	coverage := kubecost.NewWindow(&start, &start)
+	coverage := opencost.NewWindow(&start, &start)
 
 	numQuery := 1
 	for coverage.End().Before(end) {
@@ -125,7 +125,7 @@ func (cm *CostModel) buildPodMap(window kubecost.Window, resolution, maxBatchSiz
 	return nil
 }
 
-func applyPodResults(window kubecost.Window, resolution time.Duration, podMap map[podKey]*pod, clusterStart, clusterEnd map[string]time.Time, resPods []*prom.QueryResult, ingestPodUID bool, podUIDKeyMap map[podKey][]podKey) {
+func applyPodResults(window opencost.Window, resolution time.Duration, podMap map[podKey]*pod, clusterStart, clusterEnd map[string]time.Time, resPods []*prom.QueryResult, ingestPodUID bool, podUIDKeyMap map[podKey][]podKey) {
 	for _, res := range resPods {
 		if len(res.Values) == 0 {
 			log.Warnf("CostModel.ComputeAllocation: empty minutes result")
@@ -197,7 +197,7 @@ func applyPodResults(window kubecost.Window, resolution time.Duration, podMap ma
 				Start:       allocStart,
 				End:         allocEnd,
 				Key:         key,
-				Allocations: map[string]*kubecost.Allocation{},
+				Allocations: map[string]*opencost.Allocation{},
 			}
 		}
 	}
@@ -404,7 +404,7 @@ func applyCPUCoresUsedMax(podMap map[podKey]*pod, resCPUCoresUsedMax []*prom.Que
 			}
 
 			if thisPod.Allocations[container].RawAllocationOnly == nil {
-				thisPod.Allocations[container].RawAllocationOnly = &kubecost.RawAllocationOnlyData{
+				thisPod.Allocations[container].RawAllocationOnly = &opencost.RawAllocationOnlyData{
 					CPUCoreUsageMax: res.Values[0].Value,
 				}
 			} else {
@@ -604,7 +604,7 @@ func applyRAMBytesUsedMax(podMap map[podKey]*pod, resRAMBytesUsedMax []*prom.Que
 			}
 
 			if thisPod.Allocations[container].RawAllocationOnly == nil {
-				thisPod.Allocations[container].RawAllocationOnly = &kubecost.RawAllocationOnlyData{
+				thisPod.Allocations[container].RawAllocationOnly = &opencost.RawAllocationOnlyData{
 					RAMBytesUsageMax: res.Values[0].Value,
 				}
 			} else {
@@ -1301,7 +1301,7 @@ func getServiceLabels(resServiceLabels []*prom.QueryResult) map[serviceKey]map[s
 	return serviceLabels
 }
 
-func applyServicesToPods(podMap map[podKey]*pod, podLabels map[podKey]map[string]string, allocsByService map[serviceKey][]*kubecost.Allocation, serviceLabels map[serviceKey]map[string]string) {
+func applyServicesToPods(podMap map[podKey]*pod, podLabels map[podKey]map[string]string, allocsByService map[serviceKey][]*opencost.Allocation, serviceLabels map[serviceKey]map[string]string) {
 	podServicesMap := map[podKey][]serviceKey{}
 
 	// For each service, turn the labels into a selector and attempt to
@@ -1344,7 +1344,7 @@ func applyServicesToPods(podMap map[podKey]*pod, podLabels map[podKey]map[string
 	}
 }
 
-func getLoadBalancerCosts(lbMap map[serviceKey]*lbCost, resLBCost, resLBActiveMins []*prom.QueryResult, resolution time.Duration, window kubecost.Window) {
+func getLoadBalancerCosts(lbMap map[serviceKey]*lbCost, resLBCost, resLBActiveMins []*prom.QueryResult, resolution time.Duration, window opencost.Window) {
 	for _, res := range resLBActiveMins {
 		serviceKey, err := resultServiceKey(res, env.GetPromClusterLabel(), "namespace", "service_name")
 		if err != nil || len(res.Values) == 0 {
@@ -1401,17 +1401,17 @@ func getLoadBalancerCosts(lbMap map[serviceKey]*lbCost, resLBCost, resLBActiveMi
 	}
 }
 
-func applyLoadBalancersToPods(window kubecost.Window, podMap map[podKey]*pod, lbMap map[serviceKey]*lbCost, allocsByService map[serviceKey][]*kubecost.Allocation) {
+func applyLoadBalancersToPods(window opencost.Window, podMap map[podKey]*pod, lbMap map[serviceKey]*lbCost, allocsByService map[serviceKey][]*opencost.Allocation) {
 	for sKey, lb := range lbMap {
 		totalHours := 0.0
-		allocHours := make(map[*kubecost.Allocation]float64)
+		allocHours := make(map[*opencost.Allocation]float64)
 
 		allocs, ok := allocsByService[sKey]
 		// if there are no allocations using the service, add its cost to the Unmounted pod for its cluster
 		if !ok {
 			pod := getUnmountedPodForCluster(window, podMap, sKey.Cluster)
-			pod.Allocations[kubecost.UnmountedSuffix].LoadBalancerCost += lb.TotalCost
-			pod.Allocations[kubecost.UnmountedSuffix].Properties.Services = append(pod.Allocations[kubecost.UnmountedSuffix].Properties.Services, sKey.Service)
+			pod.Allocations[opencost.UnmountedSuffix].LoadBalancerCost += lb.TotalCost
+			pod.Allocations[opencost.UnmountedSuffix].Properties.Services = append(pod.Allocations[opencost.UnmountedSuffix].Properties.Services, sKey.Service)
 		}
 		// Add portion of load balancing cost to each allocation
 		// proportional to the total number of hours allocations used the load balancer
@@ -1441,13 +1441,13 @@ func applyLoadBalancersToPods(window kubecost.Window, podMap map[podKey]*pod, lb
 
 		for _, alloc := range allocs {
 			if alloc.LoadBalancers == nil {
-				alloc.LoadBalancers = kubecost.LbAllocations{}
+				alloc.LoadBalancers = opencost.LbAllocations{}
 			}
 
 			if _, found := alloc.LoadBalancers[sKey.String()]; found {
 				alloc.LoadBalancers[sKey.String()].Cost += alloc.LoadBalancerCost
 			} else {
-				alloc.LoadBalancers[sKey.String()] = &kubecost.LbAllocation{
+				alloc.LoadBalancers[sKey.String()] = &opencost.LbAllocation{
 					Service: sKey.Namespace + "/" + sKey.Service,
 					Cost:    alloc.LoadBalancerCost,
 					Private: lb.Private,
@@ -1459,8 +1459,8 @@ func applyLoadBalancersToPods(window kubecost.Window, podMap map[podKey]*pod, lb
 		// If there was no overlap apply to Unmounted pod
 		if len(allocHours) == 0 {
 			pod := getUnmountedPodForCluster(window, podMap, sKey.Cluster)
-			pod.Allocations[kubecost.UnmountedSuffix].LoadBalancerCost += lb.TotalCost
-			pod.Allocations[kubecost.UnmountedSuffix].Properties.Services = append(pod.Allocations[kubecost.UnmountedSuffix].Properties.Services, sKey.Service)
+			pod.Allocations[opencost.UnmountedSuffix].LoadBalancerCost += lb.TotalCost
+			pod.Allocations[opencost.UnmountedSuffix].Properties.Services = append(pod.Allocations[opencost.UnmountedSuffix].Properties.Services, sKey.Service)
 		}
 	}
 }
@@ -1792,7 +1792,7 @@ func (cm *CostModel) getNodePricing(nodeMap map[nodeKey]*nodePricing, nodeKey no
 
 /* PV/PVC Helpers */
 
-func buildPVMap(resolution time.Duration, pvMap map[pvKey]*pv, resPVCostPerGiBHour, resPVActiveMins, resPVMeta []*prom.QueryResult, window kubecost.Window) {
+func buildPVMap(resolution time.Duration, pvMap map[pvKey]*pv, resPVCostPerGiBHour, resPVActiveMins, resPVMeta []*prom.QueryResult, window opencost.Window) {
 	for _, result := range resPVActiveMins {
 		key, err := resultPVKey(result, env.GetPromClusterLabel(), "persistentvolume")
 		if err != nil {
@@ -1873,7 +1873,7 @@ func applyPVBytes(pvMap map[pvKey]*pv, resPVBytes []*prom.QueryResult) {
 	}
 }
 
-func buildPVCMap(resolution time.Duration, pvcMap map[pvcKey]*pvc, pvMap map[pvKey]*pv, resPVCInfo []*prom.QueryResult, window kubecost.Window) {
+func buildPVCMap(resolution time.Duration, pvcMap map[pvcKey]*pvc, pvMap map[pvKey]*pv, resPVCInfo []*prom.QueryResult, window opencost.Window) {
 	for _, res := range resPVCInfo {
 		cluster, err := res.GetString(env.GetPromClusterLabel())
 		if err != nil {
@@ -1996,7 +1996,7 @@ func buildPodPVCMap(podPVCMap map[podKey][]*pvc, pvMap map[pvKey]*pv, pvcMap map
 	}
 }
 
-func applyPVCsToPods(window kubecost.Window, podMap map[podKey]*pod, podPVCMap map[podKey][]*pvc, pvcMap map[pvcKey]*pvc) {
+func applyPVCsToPods(window opencost.Window, podMap map[podKey]*pod, podPVCMap map[podKey][]*pvc, pvcMap map[pvcKey]*pvc) {
 	// Because PVCs can be shared among pods, the respective pv cost
 	// needs to be evenly distributed to those pods based on time
 	// running, as well as the amount of time the pvc was shared.
@@ -2004,7 +2004,7 @@ func applyPVCsToPods(window kubecost.Window, podMap map[podKey]*pod, podPVCMap m
 	// Build a relation between every pvc to the pods that mount it
 	// and a window representing the interval during which they
 	// were associated.
-	pvcPodWindowMap := make(map[pvcKey]map[podKey]kubecost.Window)
+	pvcPodWindowMap := make(map[pvcKey]map[podKey]opencost.Window)
 
 	for thisPodKey, thisPod := range podMap {
 		if pvcs, ok := podPVCMap[thisPodKey]; ok {
@@ -2023,10 +2023,10 @@ func applyPVCsToPods(window kubecost.Window, podMap map[podKey]*pod, podPVCMap m
 
 				thisPVCKey := thisPVC.key()
 				if pvcPodWindowMap[thisPVCKey] == nil {
-					pvcPodWindowMap[thisPVCKey] = make(map[podKey]kubecost.Window)
+					pvcPodWindowMap[thisPVCKey] = make(map[podKey]opencost.Window)
 				}
 
-				pvcPodWindowMap[thisPVCKey][thisPodKey] = kubecost.NewWindow(&s, &e)
+				pvcPodWindowMap[thisPVCKey][thisPodKey] = opencost.NewWindow(&s, &e)
 			}
 		}
 	}
@@ -2080,9 +2080,9 @@ func applyPVCsToPods(window kubecost.Window, podMap map[podKey]*pod, podPVCMap m
 				// weighted by count (i.e. the number of containers in the pod)
 				// record the amount of total PVBytes Hours attributable to a given pv
 				if alloc.PVs == nil {
-					alloc.PVs = kubecost.PVAllocations{}
+					alloc.PVs = opencost.PVAllocations{}
 				}
-				pvKey := kubecost.PVKey{
+				pvKey := opencost.PVKey{
 					Cluster: pvc.Volume.Cluster,
 					Name:    pvc.Volume.Name,
 				}
@@ -2091,7 +2091,7 @@ func applyPVCsToPods(window kubecost.Window, podMap map[podKey]*pod, podPVCMap m
 				// so that if all allocations with a given pv key are summed the result of those
 				// would be equal to the values of the original pv
 				count := float64(len(pod.Allocations))
-				alloc.PVs[pvKey] = &kubecost.PVAllocation{
+				alloc.PVs[pvKey] = &opencost.PVAllocation{
 					ByteHours:  byteHours * coef / count,
 					Cost:       cost * coef / count,
 					ProviderID: pvc.Volume.ProviderID,
@@ -2101,7 +2101,7 @@ func applyPVCsToPods(window kubecost.Window, podMap map[podKey]*pod, podPVCMap m
 	}
 }
 
-func applyUnmountedPVs(window kubecost.Window, podMap map[podKey]*pod, pvMap map[pvKey]*pv, pvcMap map[pvcKey]*pvc) {
+func applyUnmountedPVs(window opencost.Window, podMap map[podKey]*pod, pvMap map[pvKey]*pv, pvcMap map[pvcKey]*pvc) {
 	for _, pv := range pvMap {
 		mounted := false
 		for _, pvc := range pvcMap {
@@ -2122,25 +2122,25 @@ func applyUnmountedPVs(window kubecost.Window, podMap map[podKey]*pod, pvMap map
 			// Calculate pv Cost
 
 			// Unmounted pv should have correct keyso it can still reconcile
-			thisPVKey := kubecost.PVKey{
+			thisPVKey := opencost.PVKey{
 				Cluster: pv.Cluster,
 				Name:    pv.Name,
 			}
 			gib := pv.Bytes / 1024 / 1024 / 1024
 			hrs := pv.minutes() / 60.0
 			cost := pv.CostPerGiBHour * gib * hrs
-			unmountedPVs := kubecost.PVAllocations{
+			unmountedPVs := opencost.PVAllocations{
 				thisPVKey: {
 					ByteHours: pv.Bytes * hrs,
 					Cost:      cost,
 				},
 			}
-			pod.Allocations[kubecost.UnmountedSuffix].PVs = pod.Allocations[kubecost.UnmountedSuffix].PVs.Add(unmountedPVs)
+			pod.Allocations[opencost.UnmountedSuffix].PVs = pod.Allocations[opencost.UnmountedSuffix].PVs.Add(unmountedPVs)
 		}
 	}
 }
 
-func applyUnmountedPVCs(window kubecost.Window, podMap map[podKey]*pod, pvcMap map[pvcKey]*pvc) {
+func applyUnmountedPVCs(window opencost.Window, podMap map[podKey]*pod, pvcMap map[pvcKey]*pvc) {
 	for _, pvc := range pvcMap {
 		if !pvc.Mounted && pvc.Volume != nil {
 
@@ -2150,7 +2150,7 @@ func applyUnmountedPVCs(window kubecost.Window, podMap map[podKey]*pod, pvcMap m
 			// Calculate pv Cost
 
 			// Unmounted pv should have correct key so it can still reconcile
-			thisPVKey := kubecost.PVKey{
+			thisPVKey := opencost.PVKey{
 				Cluster: pvc.Volume.Cluster,
 				Name:    pvc.Volume.Name,
 			}
@@ -2160,13 +2160,13 @@ func applyUnmountedPVCs(window kubecost.Window, podMap map[podKey]*pod, pvcMap m
 			gib := pvc.Volume.Bytes / 1024 / 1024 / 1024
 			hrs := pvc.Volume.minutes() / 60.0
 			cost := pvc.Volume.CostPerGiBHour * gib * hrs
-			unmountedPVs := kubecost.PVAllocations{
+			unmountedPVs := opencost.PVAllocations{
 				thisPVKey: {
 					ByteHours: pvc.Volume.Bytes * hrs,
 					Cost:      cost,
 				},
 			}
-			pod.Allocations[kubecost.UnmountedSuffix].PVs = pod.Allocations[kubecost.UnmountedSuffix].PVs.Add(unmountedPVs)
+			pod.Allocations[opencost.UnmountedSuffix].PVs = pod.Allocations[opencost.UnmountedSuffix].PVs.Add(unmountedPVs)
 		}
 	}
 }
@@ -2174,10 +2174,10 @@ func applyUnmountedPVCs(window kubecost.Window, podMap map[podKey]*pod, pvcMap m
 /* Helper Helpers */
 
 // getUnmountedPodForCluster retrieve the unmounted pod for a cluster and create it if it does not exist
-func getUnmountedPodForCluster(window kubecost.Window, podMap map[podKey]*pod, cluster string) *pod {
-	container := kubecost.UnmountedSuffix
-	podName := kubecost.UnmountedSuffix
-	namespace := kubecost.UnmountedSuffix
+func getUnmountedPodForCluster(window opencost.Window, podMap map[podKey]*pod, cluster string) *pod {
+	container := opencost.UnmountedSuffix
+	podName := opencost.UnmountedSuffix
+	namespace := opencost.UnmountedSuffix
 	node := ""
 
 	thisPodKey := getUnmountedPodKey(cluster)
@@ -2189,7 +2189,7 @@ func getUnmountedPodForCluster(window kubecost.Window, podMap map[podKey]*pod, c
 			Start:       *window.Start(),
 			End:         *window.End(),
 			Key:         thisPodKey,
-			Allocations: map[string]*kubecost.Allocation{},
+			Allocations: map[string]*opencost.Allocation{},
 		}
 
 		thisPod.appendContainer(container)
@@ -2208,8 +2208,8 @@ func getUnmountedPodForCluster(window kubecost.Window, podMap map[podKey]*pod, c
 
 // getUnmountedPodForNamespace is as getUnmountedPodForCluster, but keys allocation property pod/namespace field off namespace
 // This creates or adds allocations to an unmounted pod in the specified namespace, rather than in __unmounted__
-func getUnmountedPodForNamespace(window kubecost.Window, podMap map[podKey]*pod, cluster string, namespace string) *pod {
-	container := kubecost.UnmountedSuffix
+func getUnmountedPodForNamespace(window opencost.Window, podMap map[podKey]*pod, cluster string, namespace string) *pod {
+	container := opencost.UnmountedSuffix
 	podName := fmt.Sprintf("%s-unmounted-pvcs", namespace)
 	node := ""
 
@@ -2222,7 +2222,7 @@ func getUnmountedPodForNamespace(window kubecost.Window, podMap map[podKey]*pod,
 			Start:       *window.Start(),
 			End:         *window.End(),
 			Key:         thisPodKey,
-			Allocations: map[string]*kubecost.Allocation{},
+			Allocations: map[string]*opencost.Allocation{},
 		}
 
 		thisPod.appendContainer(container)
@@ -2239,7 +2239,7 @@ func getUnmountedPodForNamespace(window kubecost.Window, podMap map[podKey]*pod,
 	return thisPod
 }
 
-func calculateStartAndEnd(result *prom.QueryResult, resolution time.Duration, window kubecost.Window) (time.Time, time.Time) {
+func calculateStartAndEnd(result *prom.QueryResult, resolution time.Duration, window opencost.Window) (time.Time, time.Time) {
 	// Start and end for a range vector are pulled from the timestamps of the
 	// first and final values in the range. There is no "offsetting" required
 	// of the start or the end, as we used to do. If you query for a duration

+ 33 - 33
pkg/costmodel/allocation_helpers_test.go

@@ -5,7 +5,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util"
 	"github.com/opencost/opencost/pkg/prom"
 )
@@ -19,7 +19,7 @@ const hour = minute * 60.0
 
 var windowStart = time.Date(2020, 6, 16, 0, 0, 0, 0, time.UTC)
 var windowEnd = time.Date(2020, 6, 17, 0, 0, 0, 0, time.UTC)
-var window = kubecost.NewWindow(&windowStart, &windowEnd)
+var window = opencost.NewWindow(&windowStart, &windowEnd)
 
 var startFloat = float64(windowStart.Unix())
 
@@ -56,27 +56,27 @@ var podKey4 = podKey{
 var podKeyUnmounted = podKey{
 	namespaceKey: namespaceKey{
 		Cluster:   "cluster2",
-		Namespace: kubecost.UnmountedSuffix,
+		Namespace: opencost.UnmountedSuffix,
 	},
-	Pod: kubecost.UnmountedSuffix,
+	Pod: opencost.UnmountedSuffix,
 }
 
-var kcPVKey1 = kubecost.PVKey{
+var kcPVKey1 = opencost.PVKey{
 	Cluster: "cluster1",
 	Name:    "pv1",
 }
 
-var kcPVKey2 = kubecost.PVKey{
+var kcPVKey2 = opencost.PVKey{
 	Cluster: "cluster1",
 	Name:    "pv2",
 }
 
-var kcPVKey3 = kubecost.PVKey{
+var kcPVKey3 = opencost.PVKey{
 	Cluster: "cluster2",
 	Name:    "pv3",
 }
 
-var kcPVKey4 = kubecost.PVKey{
+var kcPVKey4 = opencost.PVKey{
 	Cluster: "cluster2",
 	Name:    "pv4",
 }
@@ -115,13 +115,13 @@ var podMap1 = map[podKey]*pod{
 		Start:  *window.Start(),
 		End:    *window.End(),
 		Key:    podKeyUnmounted,
-		Allocations: map[string]*kubecost.Allocation{
-			kubecost.UnmountedSuffix: {
-				Name: fmt.Sprintf("%s/%s/%s/%s", podKeyUnmounted.Cluster, podKeyUnmounted.Namespace, podKeyUnmounted.Pod, kubecost.UnmountedSuffix),
-				Properties: &kubecost.AllocationProperties{
+		Allocations: map[string]*opencost.Allocation{
+			opencost.UnmountedSuffix: {
+				Name: fmt.Sprintf("%s/%s/%s/%s", podKeyUnmounted.Cluster, podKeyUnmounted.Namespace, podKeyUnmounted.Pod, opencost.UnmountedSuffix),
+				Properties: &opencost.AllocationProperties{
 					Cluster:   podKeyUnmounted.Cluster,
 					Node:      "",
-					Container: kubecost.UnmountedSuffix,
+					Container: opencost.UnmountedSuffix,
 					Namespace: podKeyUnmounted.Namespace,
 					Pod:       podKeyUnmounted.Pod,
 					Services:  []string{"LB1"},
@@ -131,8 +131,8 @@ var podMap1 = map[podKey]*pod{
 				End:                        *window.End(),
 				LoadBalancerCost:           0.60,
 				LoadBalancerCostAdjustment: 0,
-				PVs: kubecost.PVAllocations{
-					kcPVKey2: &kubecost.PVAllocation{
+				PVs: opencost.PVAllocations{
+					kcPVKey2: &opencost.PVAllocation{
 						ByteHours: 24 * Gi,
 						Cost:      2.25,
 					},
@@ -365,7 +365,7 @@ func TestBuildPVMap(t *testing.T) {
 					t.Errorf("pv map is missing key %s", thisPVKey)
 				}
 				if !actualPV.equal(expectedPV) {
-					t.Errorf("pv does not match with key %s: %s != %s", thisPVKey, kubecost.NewClosedWindow(actualPV.Start, actualPV.End), kubecost.NewClosedWindow(expectedPV.Start, expectedPV.End))
+					t.Errorf("pv does not match with key %s: %s != %s", thisPVKey, opencost.NewClosedWindow(actualPV.Start, actualPV.End), opencost.NewClosedWindow(expectedPV.Start, expectedPV.End))
 				}
 			}
 		})
@@ -376,7 +376,7 @@ func TestBuildPVMap(t *testing.T) {
 
 func TestGetUnmountedPodForCluster(t *testing.T) {
 	testCases := map[string]struct {
-		window   kubecost.Window
+		window   opencost.Window
 		podMap   map[podKey]*pod
 		cluster  string
 		expected *pod
@@ -390,15 +390,15 @@ func TestGetUnmountedPodForCluster(t *testing.T) {
 				Start:  *window.Start(),
 				End:    *window.End(),
 				Key:    getUnmountedPodKey("cluster1"),
-				Allocations: map[string]*kubecost.Allocation{
-					kubecost.UnmountedSuffix: {
-						Name: fmt.Sprintf("%s/%s/%s/%s", "cluster1", kubecost.UnmountedSuffix, kubecost.UnmountedSuffix, kubecost.UnmountedSuffix),
-						Properties: &kubecost.AllocationProperties{
+				Allocations: map[string]*opencost.Allocation{
+					opencost.UnmountedSuffix: {
+						Name: fmt.Sprintf("%s/%s/%s/%s", "cluster1", opencost.UnmountedSuffix, opencost.UnmountedSuffix, opencost.UnmountedSuffix),
+						Properties: &opencost.AllocationProperties{
 							Cluster:   "cluster1",
 							Node:      "",
-							Container: kubecost.UnmountedSuffix,
-							Namespace: kubecost.UnmountedSuffix,
-							Pod:       kubecost.UnmountedSuffix,
+							Container: opencost.UnmountedSuffix,
+							Namespace: opencost.UnmountedSuffix,
+							Pod:       opencost.UnmountedSuffix,
 						},
 						Window: window,
 						Start:  *window.Start(),
@@ -416,15 +416,15 @@ func TestGetUnmountedPodForCluster(t *testing.T) {
 				Start:  *window.Start(),
 				End:    *window.End(),
 				Key:    getUnmountedPodKey("cluster2"),
-				Allocations: map[string]*kubecost.Allocation{
-					kubecost.UnmountedSuffix: {
-						Name: fmt.Sprintf("%s/%s/%s/%s", "cluster2", kubecost.UnmountedSuffix, kubecost.UnmountedSuffix, kubecost.UnmountedSuffix),
-						Properties: &kubecost.AllocationProperties{
+				Allocations: map[string]*opencost.Allocation{
+					opencost.UnmountedSuffix: {
+						Name: fmt.Sprintf("%s/%s/%s/%s", "cluster2", opencost.UnmountedSuffix, opencost.UnmountedSuffix, opencost.UnmountedSuffix),
+						Properties: &opencost.AllocationProperties{
 							Cluster:   "cluster2",
 							Node:      "",
-							Container: kubecost.UnmountedSuffix,
-							Namespace: kubecost.UnmountedSuffix,
-							Pod:       kubecost.UnmountedSuffix,
+							Container: opencost.UnmountedSuffix,
+							Namespace: opencost.UnmountedSuffix,
+							Pod:       opencost.UnmountedSuffix,
 							Services:  []string{"LB1"},
 						},
 						Window:                     window,
@@ -432,8 +432,8 @@ func TestGetUnmountedPodForCluster(t *testing.T) {
 						End:                        *window.End(),
 						LoadBalancerCost:           .60,
 						LoadBalancerCostAdjustment: 0,
-						PVs: kubecost.PVAllocations{
-							kcPVKey2: &kubecost.PVAllocation{
+						PVs: opencost.PVAllocations{
+							kcPVKey2: &opencost.PVAllocation{
 								ByteHours: 24 * Gi,
 								Cost:      2.25,
 							},

+ 9 - 9
pkg/costmodel/allocation_incubating.go

@@ -6,8 +6,8 @@ import (
 	"fmt"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/pkg/env"
 	"github.com/opencost/opencost/pkg/prom"
 )
@@ -33,7 +33,7 @@ type NodeTotals struct {
 // for the window defined by the given start and end times. The Allocations returned are unaggregated
 // (i.e. down to the container level), and the node totals should contained additional data that can be
 // used to calculate the idle costs at the node level.
-func (cm *CostModel) ComputeAllocationWithNodeTotals(start, end time.Time, resolution time.Duration) (*kubecost.AllocationSet, map[string]*NodeTotals, error) {
+func (cm *CostModel) ComputeAllocationWithNodeTotals(start, end time.Time, resolution time.Duration) (*opencost.AllocationSet, map[string]*NodeTotals, error) {
 	nodeMap := make(map[string]*NodeTotals)
 
 	// If the duration is short enough, compute the AllocationSet directly
@@ -53,7 +53,7 @@ func (cm *CostModel) ComputeAllocationWithNodeTotals(start, end time.Time, resol
 
 	// Collect AllocationSets in a range, then accumulate
 	// TODO optimize by collecting consecutive AllocationSets, accumulating as we go
-	asr := kubecost.NewAllocationSetRange()
+	asr := opencost.NewAllocationSetRange()
 
 	for e.Before(end) {
 		// By default, query for the full remaining duration. But do not let
@@ -71,7 +71,7 @@ func (cm *CostModel) ComputeAllocationWithNodeTotals(start, end time.Time, resol
 		as, nodeData, err := cm.computeAllocation(s, e, resolution)
 		appendNodeData(nodeMap, s, e, nodeData)
 		if err != nil {
-			return kubecost.NewAllocationSet(start, end), nodeMap, fmt.Errorf("error computing allocation for %s: %s", kubecost.NewClosedWindow(s, e), err)
+			return opencost.NewAllocationSet(start, end), nodeMap, fmt.Errorf("error computing allocation for %s: %s", opencost.NewClosedWindow(s, e), err)
 		}
 
 		// Append to the range
@@ -130,15 +130,15 @@ func (cm *CostModel) ComputeAllocationWithNodeTotals(start, end time.Time, resol
 	// Accumulate to yield the result AllocationSet. After this step, we will
 	// be nearly complete, but without the raw allocation data, which must be
 	// recomputed.
-	resultASR, err := asr.Accumulate(kubecost.AccumulateOptionAll)
+	resultASR, err := asr.Accumulate(opencost.AccumulateOptionAll)
 	if err != nil {
-		return kubecost.NewAllocationSet(start, end), nil, fmt.Errorf("error accumulating data for %s: %s", kubecost.NewClosedWindow(s, e), err)
+		return opencost.NewAllocationSet(start, end), nil, fmt.Errorf("error accumulating data for %s: %s", opencost.NewClosedWindow(s, e), err)
 	}
 	if resultASR != nil && len(resultASR.Allocations) == 0 {
-		return kubecost.NewAllocationSet(start, end), nil, nil
+		return opencost.NewAllocationSet(start, end), nil, nil
 	}
 	if length := len(resultASR.Allocations); length != 1 {
-		return kubecost.NewAllocationSet(start, end), nil, fmt.Errorf("expected 1 accumulated allocation set, found %d sets", length)
+		return opencost.NewAllocationSet(start, end), nil, fmt.Errorf("expected 1 accumulated allocation set, found %d sets", length)
 	}
 	result := resultASR.Allocations[0]
 
@@ -176,7 +176,7 @@ func (cm *CostModel) ComputeAllocationWithNodeTotals(start, end time.Time, resol
 			}
 
 			if resultAlloc.RawAllocationOnly == nil {
-				resultAlloc.RawAllocationOnly = &kubecost.RawAllocationOnlyData{}
+				resultAlloc.RawAllocationOnly = &opencost.RawAllocationOnlyData{}
 			}
 
 			if alloc.RawAllocationOnly == nil {

+ 6 - 6
pkg/costmodel/allocation_types.go

@@ -4,18 +4,18 @@ import (
 	"fmt"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 )
 
 // pod describes a running pod's start and end time within a Window and
 // all the Allocations (i.e. containers) contained within it.
 type pod struct {
-	Window      kubecost.Window
+	Window      opencost.Window
 	Start       time.Time
 	End         time.Time
 	Key         podKey
 	Node        string
-	Allocations map[string]*kubecost.Allocation
+	Allocations map[string]*opencost.Allocation
 }
 
 func (p *pod) equal(that *pod) bool {
@@ -60,9 +60,9 @@ func (p *pod) equal(that *pod) bool {
 func (p *pod) appendContainer(container string) {
 	name := fmt.Sprintf("%s/%s/%s/%s", p.Key.Cluster, p.Key.Namespace, p.Key.Pod, container)
 
-	alloc := &kubecost.Allocation{
+	alloc := &opencost.Allocation{
 		Name:       name,
-		Properties: &kubecost.AllocationProperties{},
+		Properties: &opencost.AllocationProperties{},
 		Window:     p.Window.Clone(),
 		Start:      p.Start,
 		End:        p.End,
@@ -115,7 +115,7 @@ func (p *pvc) String() string {
 	if p == nil {
 		return "<nil>"
 	}
-	return fmt.Sprintf("%s/%s/%s{Bytes:%.2f, Cost:%.6f, Start,End:%s}", p.Cluster, p.Namespace, p.Name, p.Bytes, p.Cost(), kubecost.NewWindow(&p.Start, &p.End))
+	return fmt.Sprintf("%s/%s/%s{Bytes:%.2f, Cost:%.6f, Start,End:%s}", p.Cluster, p.Namespace, p.Name, p.Bytes, p.Cost(), opencost.NewWindow(&p.Start, &p.End))
 }
 
 // Key returns the pvcKey for the calling pvc

+ 16 - 16
pkg/costmodel/assets.go

@@ -4,27 +4,27 @@ import (
 	"fmt"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 )
 
-func (cm *CostModel) ComputeAssets(start, end time.Time) (*kubecost.AssetSet, error) {
-	assetSet := kubecost.NewAssetSet(start, end)
+func (cm *CostModel) ComputeAssets(start, end time.Time) (*opencost.AssetSet, error) {
+	assetSet := opencost.NewAssetSet(start, end)
 
 	nodeMap, err := cm.ClusterNodes(start, end)
 	if err != nil {
-		return nil, fmt.Errorf("error computing node assets for %s: %w", kubecost.NewClosedWindow(start, end), err)
+		return nil, fmt.Errorf("error computing node assets for %s: %w", opencost.NewClosedWindow(start, end), err)
 
 	}
 
 	lbMap, err := cm.ClusterLoadBalancers(start, end)
 	if err != nil {
-		return nil, fmt.Errorf("error computing load balancer assets for %s: %w", kubecost.NewClosedWindow(start, end), err)
+		return nil, fmt.Errorf("error computing load balancer assets for %s: %w", opencost.NewClosedWindow(start, end), err)
 	}
 
 	diskMap, err := cm.ClusterDisks(start, end)
 	if err != nil {
-		return nil, fmt.Errorf("error computing disk assets for %s: %w", kubecost.NewClosedWindow(start, end), err)
+		return nil, fmt.Errorf("error computing disk assets for %s: %w", opencost.NewClosedWindow(start, end), err)
 	}
 
 	for _, d := range diskMap {
@@ -42,7 +42,7 @@ func (cm *CostModel) ComputeAssets(start, end time.Time) (*kubecost.AssetSet, er
 
 		hours := e.Sub(s).Hours()
 
-		disk := kubecost.NewDisk(d.Name, d.Cluster, d.ProviderID, s, e, kubecost.NewWindow(&start, &end))
+		disk := opencost.NewDisk(d.Name, d.Cluster, d.ProviderID, s, e, opencost.NewWindow(&start, &end))
 		cm.PropertiesFromCluster(disk.Properties)
 		disk.Cost = d.Cost
 		disk.ByteHours = d.Bytes * hours
@@ -58,7 +58,7 @@ func (cm *CostModel) ComputeAssets(start, end time.Time) (*kubecost.AssetSet, er
 		if d.Local {
 			disk.Local = 1.0
 		}
-		disk.Breakdown = &kubecost.Breakdown{
+		disk.Breakdown = &opencost.Breakdown{
 			Idle:   d.Breakdown.Idle,
 			System: d.Breakdown.System,
 			User:   d.Breakdown.User,
@@ -84,7 +84,7 @@ func (cm *CostModel) ComputeAssets(start, end time.Time) (*kubecost.AssetSet, er
 			e = end
 		}
 
-		loadBalancer := kubecost.NewLoadBalancer(lb.Name, lb.Cluster, lb.ProviderID, s, e, kubecost.NewWindow(&start, &end), lb.Private, lb.Ip)
+		loadBalancer := opencost.NewLoadBalancer(lb.Name, lb.Cluster, lb.ProviderID, s, e, opencost.NewWindow(&start, &end), lb.Private, lb.Ip)
 		cm.PropertiesFromCluster(loadBalancer.Properties)
 		loadBalancer.Cost = lb.Cost
 		assetSet.Insert(loadBalancer, nil)
@@ -111,19 +111,19 @@ func (cm *CostModel) ComputeAssets(start, end time.Time) (*kubecost.AssetSet, er
 
 		hours := e.Sub(s).Hours()
 
-		node := kubecost.NewNode(n.Name, n.Cluster, n.ProviderID, s, e, kubecost.NewWindow(&start, &end))
+		node := opencost.NewNode(n.Name, n.Cluster, n.ProviderID, s, e, opencost.NewWindow(&start, &end))
 		cm.PropertiesFromCluster(node.Properties)
 		node.NodeType = n.NodeType
 		node.CPUCoreHours = n.CPUCores * hours
 		node.RAMByteHours = n.RAMBytes * hours
 		node.GPUHours = n.GPUCount * hours
-		node.CPUBreakdown = &kubecost.Breakdown{
+		node.CPUBreakdown = &opencost.Breakdown{
 			Idle:   n.CPUBreakdown.Idle,
 			System: n.CPUBreakdown.System,
 			User:   n.CPUBreakdown.User,
 			Other:  n.CPUBreakdown.Other,
 		}
-		node.RAMBreakdown = &kubecost.Breakdown{
+		node.RAMBreakdown = &opencost.Breakdown{
 			Idle:   n.RAMBreakdown.Idle,
 			System: n.RAMBreakdown.System,
 			User:   n.RAMBreakdown.User,
@@ -135,20 +135,20 @@ func (cm *CostModel) ComputeAssets(start, end time.Time) (*kubecost.AssetSet, er
 		node.RAMCost = n.RAMCost
 
 		if n.Overhead != nil {
-			node.Overhead = &kubecost.NodeOverhead{
+			node.Overhead = &opencost.NodeOverhead{
 				RamOverheadFraction: n.Overhead.RamOverheadFraction,
 				CpuOverheadFraction: n.Overhead.CpuOverheadFraction,
 				OverheadCostFraction: ((n.Overhead.CpuOverheadFraction * n.CPUCost) +
 					(n.Overhead.RamOverheadFraction * n.RAMCost)) / node.TotalCost(),
 			}
 		} else {
-			node.Overhead = &kubecost.NodeOverhead{}
+			node.Overhead = &opencost.NodeOverhead{}
 		}
 		node.Discount = n.Discount
 		if n.Preemptible {
 			node.Preemptible = 1.0
 		}
-		node.SetLabels(kubecost.AssetLabels(n.Labels))
+		node.SetLabels(opencost.AssetLabels(n.Labels))
 		assetSet.Insert(node, nil)
 	}
 
@@ -168,7 +168,7 @@ func (cm *CostModel) ClusterNodes(start, end time.Time) (map[NodeIdentifier]*Nod
 }
 
 // propertiesFromCluster populates static cluster properties to individual asset properties
-func (cm *CostModel) PropertiesFromCluster(props *kubecost.AssetProperties) {
+func (cm *CostModel) PropertiesFromCluster(props *opencost.AssetProperties) {
 	// If properties does not have cluster value, do nothing
 	if props.Cluster == "" {
 		return

+ 9 - 9
pkg/costmodel/cluster.go

@@ -10,8 +10,8 @@ import (
 	prometheus "github.com/prometheus/client_golang/api"
 	"golang.org/x/exp/slices"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util/timeutil"
 	"github.com/opencost/opencost/pkg/cloud/models"
 	"github.com/opencost/opencost/pkg/env"
@@ -159,7 +159,7 @@ func ClusterDisks(client prometheus.Client, provider models.Provider, start, end
 
 	durStr := timeutil.DurationString(end.Sub(start))
 	if durStr == "" {
-		return nil, fmt.Errorf("illegal duration value for %s", kubecost.NewClosedWindow(start, end))
+		return nil, fmt.Errorf("illegal duration value for %s", opencost.NewClosedWindow(start, end))
 	}
 	// hourlyToCumulative is a scaling factor that, when multiplied by an hourly
 	// value, converts it to a cumulative value; i.e.
@@ -254,7 +254,7 @@ func ClusterDisks(client prometheus.Client, provider models.Provider, start, end
 		diskMap[key].ClaimNamespace = claimNamespace
 	}
 
-	pvCosts(diskMap, resolution, resActiveMins, resPVSize, resPVCost, resPVUsedAvg, resPVUsedMax, resPVCInfo, provider, kubecost.NewClosedWindow(start, end))
+	pvCosts(diskMap, resolution, resActiveMins, resPVSize, resPVCost, resPVUsedAvg, resPVUsedMax, resPVCInfo, provider, opencost.NewClosedWindow(start, end))
 
 	for _, result := range resLocalStorageCost {
 		cluster, err := result.GetString(env.GetPromClusterLabel())
@@ -281,7 +281,7 @@ func ClusterDisks(client prometheus.Client, provider models.Provider, start, end
 		diskMap[key].Cost += cost
 
 		//Assigning explicitly the storage class of local storage to local
-		diskMap[key].StorageClass = kubecost.LocalStorageClass
+		diskMap[key].StorageClass = opencost.LocalStorageClass
 	}
 
 	for _, result := range resLocalStorageUsedCost {
@@ -446,7 +446,7 @@ func ClusterDisks(client prometheus.Client, provider models.Provider, start, end
 		storageClass, err := result.GetString("storageclass")
 
 		if err != nil {
-			diskMap[key].StorageClass = kubecost.UnknownStorageClass
+			diskMap[key].StorageClass = opencost.UnknownStorageClass
 		} else {
 			diskMap[key].StorageClass = storageClass
 		}
@@ -563,7 +563,7 @@ func ClusterNodes(cp models.Provider, client prometheus.Client, start, end time.
 
 	durStr := timeutil.DurationString(end.Sub(start))
 	if durStr == "" {
-		return nil, fmt.Errorf("illegal duration value for %s", kubecost.NewClosedWindow(start, end))
+		return nil, fmt.Errorf("illegal duration value for %s", opencost.NewClosedWindow(start, end))
 	}
 
 	requiredCtx := prom.NewNamedContext(client, prom.ClusterContextName)
@@ -630,7 +630,7 @@ func ClusterNodes(cp models.Provider, client prometheus.Client, start, end time.
 		return nil, requiredCtx.ErrorCollection()
 	}
 
-	activeDataMap := buildActiveDataMap(resActiveMins, resolution, kubecost.NewClosedWindow(start, end))
+	activeDataMap := buildActiveDataMap(resActiveMins, resolution, opencost.NewClosedWindow(start, end))
 
 	gpuCountMap := buildGPUCountMap(resNodeGPUCount)
 	preemptibleMap := buildPreemptibleMap(resIsSpot)
@@ -738,7 +738,7 @@ func ClusterLoadBalancers(client prometheus.Client, start, end time.Time) (map[L
 	// Query for the duration between start and end
 	durStr := timeutil.DurationString(end.Sub(start))
 	if durStr == "" {
-		return nil, fmt.Errorf("illegal duration value for %s", kubecost.NewClosedWindow(start, end))
+		return nil, fmt.Errorf("illegal duration value for %s", opencost.NewClosedWindow(start, end))
 	}
 
 	ctx := prom.NewNamedContext(client, prom.ClusterContextName)
@@ -1343,7 +1343,7 @@ func ClusterCostsOverTime(cli prometheus.Client, provider models.Provider, start
 	}, nil
 }
 
-func pvCosts(diskMap map[DiskIdentifier]*Disk, resolution time.Duration, resActiveMins, resPVSize, resPVCost, resPVUsedAvg, resPVUsedMax, resPVCInfo []*prom.QueryResult, cp models.Provider, window kubecost.Window) {
+func pvCosts(diskMap map[DiskIdentifier]*Disk, resolution time.Duration, resActiveMins, resPVSize, resPVCost, resPVUsedAvg, resPVUsedMax, resPVCInfo []*prom.QueryResult, cp models.Provider, window opencost.Window) {
 	for _, result := range resActiveMins {
 		cluster, err := result.GetString(env.GetPromClusterLabel())
 		if err != nil {

+ 2 - 2
pkg/costmodel/cluster_helpers.go

@@ -4,11 +4,11 @@ import (
 	"strconv"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/pkg/cloud/models"
 	"github.com/opencost/opencost/pkg/cloud/provider"
 
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/pkg/env"
 	"github.com/opencost/opencost/pkg/prom"
 )
@@ -528,7 +528,7 @@ type activeData struct {
 	minutes float64
 }
 
-func buildActiveDataMap(resActiveMins []*prom.QueryResult, resolution time.Duration, window kubecost.Window) map[NodeIdentifier]activeData {
+func buildActiveDataMap(resActiveMins []*prom.QueryResult, resolution time.Duration, window opencost.Window) map[NodeIdentifier]activeData {
 
 	m := make(map[NodeIdentifier]activeData)
 

+ 2 - 2
pkg/costmodel/cluster_helpers_test.go

@@ -6,7 +6,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util"
 	"github.com/opencost/opencost/pkg/cloud/provider"
 	"github.com/opencost/opencost/pkg/config"
@@ -895,7 +895,7 @@ func TestAssetCustompricing(t *testing.T) {
 
 	windowStart := time.Date(2020, time.April, 13, 0, 0, 0, 0, time.UTC)
 	windowEnd := windowStart.Add(time.Hour)
-	window := kubecost.NewClosedWindow(windowStart, windowEnd)
+	window := opencost.NewClosedWindow(windowStart, windowEnd)
 
 	startTimestamp := float64(windowStart.Unix())
 

+ 31 - 31
pkg/costmodel/costmodel.go

@@ -10,8 +10,8 @@ import (
 	"time"
 
 	"github.com/opencost/opencost/core/pkg/clusters"
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
 	costAnalyzerCloud "github.com/opencost/opencost/pkg/cloud/models"
@@ -1650,7 +1650,7 @@ func floorMultiple(value int64, multiple int64) int64 {
 
 // Attempt to create a key for the request. Reduce the times to minutes in order to more easily group requests based on
 // real time ranges. If for any reason, the key generation fails, return a uuid to ensure uniqueness.
-func requestKeyFor(window kubecost.Window, resolution time.Duration, filterNamespace string, filterCluster string, remoteEnabled bool) string {
+func requestKeyFor(window opencost.Window, resolution time.Duration, filterNamespace string, filterCluster string, remoteEnabled bool) string {
 	keyLayout := "2006-01-02T15:04Z"
 
 	// We "snap" start time and duration to their closest 5 min multiple less than itself, by
@@ -1672,7 +1672,7 @@ func requestKeyFor(window kubecost.Window, resolution time.Duration, filterNames
 
 // ComputeCostDataRange executes a range query for cost data.
 // Note that "offset" represents the time between the function call and "endString", and is also passed for convenience
-func (cm *CostModel) ComputeCostDataRange(cli prometheusClient.Client, cp costAnalyzerCloud.Provider, window kubecost.Window, resolution time.Duration, filterNamespace string, filterCluster string, remoteEnabled bool) (map[string]*CostData, error) {
+func (cm *CostModel) ComputeCostDataRange(cli prometheusClient.Client, cp costAnalyzerCloud.Provider, window opencost.Window, resolution time.Duration, filterNamespace string, filterCluster string, remoteEnabled bool) (map[string]*CostData, error) {
 	// Create a request key for request grouping. This key will be used to represent the cost-model result
 	// for the specific inputs to prevent multiple queries for identical data.
 	key := requestKeyFor(window, resolution, filterNamespace, filterCluster, remoteEnabled)
@@ -1693,7 +1693,7 @@ func (cm *CostModel) ComputeCostDataRange(cli prometheusClient.Client, cp costAn
 	return data, err
 }
 
-func (cm *CostModel) costDataRange(cli prometheusClient.Client, cp costAnalyzerCloud.Provider, window kubecost.Window, resolution time.Duration, filterNamespace string, filterCluster string, remoteEnabled bool) (map[string]*CostData, error) {
+func (cm *CostModel) costDataRange(cli prometheusClient.Client, cp costAnalyzerCloud.Provider, window opencost.Window, resolution time.Duration, filterNamespace string, filterCluster string, remoteEnabled bool) (map[string]*CostData, error) {
 	clusterID := env.GetClusterID()
 
 	// durHrs := end.Sub(start).Hours() + 1
@@ -2404,23 +2404,23 @@ func measureTimeAsync(start time.Time, threshold time.Duration, name string, ch
 	}
 }
 
-func (cm *CostModel) QueryAllocation(window kubecost.Window, resolution, step time.Duration, aggregate []string, includeIdle, idleByNode, includeProportionalAssetResourceCosts, includeAggregatedMetadata, sharedLoadBalancer bool, accumulateBy kubecost.AccumulateOption) (*kubecost.AllocationSetRange, error) {
+func (cm *CostModel) QueryAllocation(window opencost.Window, resolution, step time.Duration, aggregate []string, includeIdle, idleByNode, includeProportionalAssetResourceCosts, includeAggregatedMetadata, sharedLoadBalancer bool, accumulateBy opencost.AccumulateOption) (*opencost.AllocationSetRange, error) {
 	// Validate window is legal
 	if window.IsOpen() || window.IsNegative() {
 		return nil, fmt.Errorf("illegal window: %s", window)
 	}
 
-	var totalsStore kubecost.TotalsStore
+	var totalsStore opencost.TotalsStore
 	// Idle is required for proportional asset costs
 	if includeProportionalAssetResourceCosts {
 		if !includeIdle {
 			return nil, errors.New("bad request - includeIdle must be set true if includeProportionalAssetResourceCosts is true")
 		}
-		totalsStore = kubecost.NewMemoryTotalsStore()
+		totalsStore = opencost.NewMemoryTotalsStore()
 	}
 
 	// Begin with empty response
-	asr := kubecost.NewAllocationSetRange()
+	asr := opencost.NewAllocationSetRange()
 
 	// Query for AllocationSets in increments of the given step duration,
 	// appending each to the response.
@@ -2430,13 +2430,13 @@ func (cm *CostModel) QueryAllocation(window kubecost.Window, resolution, step ti
 	for window.End().After(stepStart) {
 		allocSet, err := cm.ComputeAllocation(stepStart, stepEnd, resolution)
 		if err != nil {
-			return nil, fmt.Errorf("error computing allocations for %s: %w", kubecost.NewClosedWindow(stepStart, stepEnd), err)
+			return nil, fmt.Errorf("error computing allocations for %s: %w", opencost.NewClosedWindow(stepStart, stepEnd), err)
 		}
 
 		if includeIdle {
 			assetSet, err := cm.ComputeAssets(stepStart, stepEnd)
 			if err != nil {
-				return nil, fmt.Errorf("error computing assets for %s: %w", kubecost.NewClosedWindow(stepStart, stepEnd), err)
+				return nil, fmt.Errorf("error computing assets for %s: %w", opencost.NewClosedWindow(stepStart, stepEnd), err)
 			}
 
 			if includeProportionalAssetResourceCosts {
@@ -2452,7 +2452,7 @@ func (cm *CostModel) QueryAllocation(window kubecost.Window, resolution, step ti
 					}
 				}
 
-				_, err := kubecost.UpdateAssetTotalsStore(totalsStore, assetSet)
+				_, err := opencost.UpdateAssetTotalsStore(totalsStore, assetSet)
 				if err != nil {
 					log.Errorf("ETL: error updating asset resource totals for %s: %s", assetSet.Window, err)
 				}
@@ -2460,7 +2460,7 @@ func (cm *CostModel) QueryAllocation(window kubecost.Window, resolution, step ti
 
 			idleSet, err := computeIdleAllocations(allocSet, assetSet, true)
 			if err != nil {
-				return nil, fmt.Errorf("error computing idle allocations for %s: %w", kubecost.NewClosedWindow(stepStart, stepEnd), err)
+				return nil, fmt.Errorf("error computing idle allocations for %s: %w", opencost.NewClosedWindow(stepStart, stepEnd), err)
 			}
 
 			for _, idleAlloc := range idleSet.Allocations {
@@ -2475,7 +2475,7 @@ func (cm *CostModel) QueryAllocation(window kubecost.Window, resolution, step ti
 	}
 
 	// Set aggregation options and aggregate
-	opts := &kubecost.AllocationAggregationOptions{
+	opts := &opencost.AllocationAggregationOptions{
 		IncludeProportionalAssetResourceCosts: includeProportionalAssetResourceCosts,
 		IdleByNode:                            idleByNode,
 		IncludeAggregatedMetadata:             includeAggregatedMetadata,
@@ -2488,7 +2488,7 @@ func (cm *CostModel) QueryAllocation(window kubecost.Window, resolution, step ti
 	}
 
 	// Accumulate, if requested
-	if accumulateBy != kubecost.AccumulateOptionNone {
+	if accumulateBy != opencost.AccumulateOptionNone {
 		asr, err = asr.Accumulate(accumulateBy)
 		if err != nil {
 			log.Errorf("error accumulating by %v: %s", accumulateBy, err)
@@ -2500,12 +2500,12 @@ func (cm *CostModel) QueryAllocation(window kubecost.Window, resolution, step ti
 		if includeProportionalAssetResourceCosts {
 			assetSet, err := cm.ComputeAssets(*asr.Window().Start(), *asr.Window().End())
 			if err != nil {
-				return nil, fmt.Errorf("error computing assets for %s: %w", kubecost.NewClosedWindow(*asr.Window().Start(), *asr.Window().End()), err)
+				return nil, fmt.Errorf("error computing assets for %s: %w", opencost.NewClosedWindow(*asr.Window().Start(), *asr.Window().End()), err)
 			}
 
-			_, err = kubecost.UpdateAssetTotalsStore(totalsStore, assetSet)
+			_, err = opencost.UpdateAssetTotalsStore(totalsStore, assetSet)
 			if err != nil {
-				log.Errorf("ETL: error updating asset resource totals for %s: %s", kubecost.NewClosedWindow(*asr.Window().Start(), *asr.Window().End()), err)
+				log.Errorf("ETL: error updating asset resource totals for %s: %s", opencost.NewClosedWindow(*asr.Window().Start(), *asr.Window().End()), err)
 			}
 
 		}
@@ -2545,7 +2545,7 @@ func (cm *CostModel) QueryAllocation(window kubecost.Window, resolution, step ti
 					key := strings.TrimSuffix(strings.ReplaceAll(rawKey, ",", "/"), "/")
 					// for each parc , check the totals store for each
 					// on a totals hit, set the corresponding total and calculate percentage
-					var totals *kubecost.AssetTotals
+					var totals *opencost.AssetTotals
 					if totalsLoc, found := totalStoreByCluster[key]; found {
 						totals = totalsLoc
 					}
@@ -2582,7 +2582,7 @@ func (cm *CostModel) QueryAllocation(window kubecost.Window, resolution, step ti
 						parc.LoadBalancerTotalCost = totals.LoadBalancerCost
 					}
 
-					kubecost.ComputePercentages(&parc)
+					opencost.ComputePercentages(&parc)
 					alloc.ProportionalAssetResourceCosts[rawKey] = parc
 				}
 			}
@@ -2593,24 +2593,24 @@ func (cm *CostModel) QueryAllocation(window kubecost.Window, resolution, step ti
 	return asr, nil
 }
 
-func computeIdleAllocations(allocSet *kubecost.AllocationSet, assetSet *kubecost.AssetSet, idleByNode bool) (*kubecost.AllocationSet, error) {
+func computeIdleAllocations(allocSet *opencost.AllocationSet, assetSet *opencost.AssetSet, idleByNode bool) (*opencost.AllocationSet, error) {
 	if !allocSet.Window.Equal(assetSet.Window) {
 		return nil, fmt.Errorf("cannot compute idle allocations for mismatched sets: %s does not equal %s", allocSet.Window, assetSet.Window)
 	}
 
-	var allocTotals map[string]*kubecost.AllocationTotals
-	var assetTotals map[string]*kubecost.AssetTotals
+	var allocTotals map[string]*opencost.AllocationTotals
+	var assetTotals map[string]*opencost.AssetTotals
 
 	if idleByNode {
-		allocTotals = kubecost.ComputeAllocationTotals(allocSet, kubecost.AllocationNodeProp)
-		assetTotals = kubecost.ComputeAssetTotals(assetSet, true)
+		allocTotals = opencost.ComputeAllocationTotals(allocSet, opencost.AllocationNodeProp)
+		assetTotals = opencost.ComputeAssetTotals(assetSet, true)
 	} else {
-		allocTotals = kubecost.ComputeAllocationTotals(allocSet, kubecost.AllocationClusterProp)
-		assetTotals = kubecost.ComputeAssetTotals(assetSet, false)
+		allocTotals = opencost.ComputeAllocationTotals(allocSet, opencost.AllocationClusterProp)
+		assetTotals = opencost.ComputeAssetTotals(assetSet, false)
 	}
 
 	start, end := *allocSet.Window.Start(), *allocSet.Window.End()
-	idleSet := kubecost.NewAllocationSet(start, end)
+	idleSet := opencost.NewAllocationSet(start, end)
 
 	for key, assetTotal := range assetTotals {
 		allocTotal, ok := allocTotals[key]
@@ -2620,7 +2620,7 @@ func computeIdleAllocations(allocSet *kubecost.AllocationSet, assetSet *kubecost
 			// Use a zero-value set of totals. This indicates either (1) an
 			// error computing totals, or (2) that no allocations ran on the
 			// given node for the given window.
-			allocTotal = &kubecost.AllocationTotals{
+			allocTotal = &opencost.AllocationTotals{
 				Cluster: assetTotal.Cluster,
 				Node:    assetTotal.Node,
 				Start:   assetTotal.Start,
@@ -2631,11 +2631,11 @@ func computeIdleAllocations(allocSet *kubecost.AllocationSet, assetSet *kubecost
 		// Insert one idle allocation for each key (whether by node or
 		// by cluster), defined as the difference between the total
 		// asset cost and the allocated cost per-resource.
-		name := fmt.Sprintf("%s/%s", key, kubecost.IdleSuffix)
-		err := idleSet.Insert(&kubecost.Allocation{
+		name := fmt.Sprintf("%s/%s", key, opencost.IdleSuffix)
+		err := idleSet.Insert(&opencost.Allocation{
 			Name:   name,
 			Window: idleSet.Window.Clone(),
-			Properties: &kubecost.AllocationProperties{
+			Properties: &opencost.AllocationProperties{
 				Cluster:    assetTotal.Cluster,
 				Node:       assetTotal.Node,
 				ProviderID: assetTotal.Node,

+ 3 - 3
pkg/costmodel/csv_export.go

@@ -12,13 +12,13 @@ import (
 	"strconv"
 	"time"
 
-	"github.com/opencost/opencost/core/pkg/kubecost"
 	"github.com/opencost/opencost/core/pkg/log"
+	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/pkg/filemanager"
 )
 
 type AllocationModel interface {
-	ComputeAllocation(start, end time.Time, resolution time.Duration) (*kubecost.AllocationSet, error)
+	ComputeAllocation(start, end time.Time, resolution time.Duration) (*opencost.AllocationSet, error)
 	DateRange() (time.Time, time.Time, error)
 }
 
@@ -161,7 +161,7 @@ func (e *csvExporter) writeCSVToWriter(ctx context.Context, w io.Writer, dates [
 
 	type rowData struct {
 		date  time.Time
-		alloc *kubecost.Allocation
+		alloc *opencost.Allocation
 	}
 
 	type columnDef struct {

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff