Przeglądaj źródła

Update dependencies for clustercache to use core only

Matt Bolt 1 rok temu
rodzic
commit
72288a3725
49 zmienionych plików z 587 dodań i 770 usunięć
  1. 2 2
      core/go.mod
  2. 4 7
      core/go.sum
  3. 408 0
      core/pkg/clustercache/clustercache.go
  4. 1 1
      go.mod
  5. 2 2
      go.sum
  6. 2 58
      modules/collector-source/go.mod
  7. 2 143
      modules/collector-source/go.sum
  8. 1 1
      modules/collector-source/pkg/collector/scraper.go
  9. 1 1
      modules/collector-source/pkg/collector/scraper_test.go
  10. 1 1
      modules/prometheus-source/go.mod
  11. 2 2
      modules/prometheus-source/go.sum
  12. 1 1
      pkg/cloud/alibaba/provider.go
  13. 1 1
      pkg/cloud/alibaba/provider_test.go
  14. 1 1
      pkg/cloud/aws/provider.go
  15. 1 1
      pkg/cloud/aws/provider_test.go
  16. 1 1
      pkg/cloud/azure/provider.go
  17. 1 1
      pkg/cloud/gcp/provider.go
  18. 1 1
      pkg/cloud/models/models.go
  19. 1 1
      pkg/cloud/oracle/provider.go
  20. 1 1
      pkg/cloud/oracle/provider_test.go
  21. 1 1
      pkg/cloud/otc/provider.go
  22. 1 1
      pkg/cloud/provider/csvprovider.go
  23. 1 1
      pkg/cloud/provider/customprovider.go
  24. 1 1
      pkg/cloud/provider/provider.go
  25. 1 1
      pkg/cloud/scaleway/provider.go
  26. 45 441
      pkg/clustercache/clustercache.go
  27. 43 42
      pkg/clustercache/clustercache2.go
  28. 17 16
      pkg/clustercache/clusterexporter.go
  29. 16 15
      pkg/clustercache/clusterimporter.go
  30. 5 4
      pkg/cmd/agent/agent.go
  31. 1 1
      pkg/costmodel/containerkeys.go
  32. 1 1
      pkg/costmodel/costmodel.go
  33. 1 1
      pkg/costmodel/costmodel_test.go
  34. 1 1
      pkg/costmodel/metrics.go
  35. 1 1
      pkg/costmodel/resultparsers.go
  36. 3 2
      pkg/costmodel/router.go
  37. 1 1
      pkg/metrics/deploymentmetrics.go
  38. 1 1
      pkg/metrics/jobmetrics.go
  39. 1 1
      pkg/metrics/kubemetrics.go
  40. 1 1
      pkg/metrics/namespacemetrics.go
  41. 1 1
      pkg/metrics/nodemetrics.go
  42. 1 1
      pkg/metrics/podlabelmetrics.go
  43. 1 1
      pkg/metrics/podlabelmetrics_test.go
  44. 1 1
      pkg/metrics/podmetrics.go
  45. 1 1
      pkg/metrics/pvcmetrics.go
  46. 1 1
      pkg/metrics/pvmetrics.go
  47. 1 1
      pkg/metrics/servicemetrics.go
  48. 1 1
      pkg/metrics/statefulsetmetrics.go
  49. 1 1
      test/cloud_test.go

+ 2 - 2
core/go.mod

@@ -32,6 +32,7 @@ require (
 	gopkg.in/yaml.v2 v2.4.0
 	k8s.io/api v0.25.3
 	k8s.io/apimachinery v0.25.3
+	k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e
 )
 
 require (
@@ -108,8 +109,7 @@ require (
 	google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect
 	gopkg.in/inf.v0 v0.9.1 // indirect
 	gopkg.in/ini.v1 v1.67.0 // indirect
-	k8s.io/klog/v2 v2.80.0 // indirect
-	k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
+	k8s.io/klog/v2 v2.80.1 // indirect
 	sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
 	sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
 	sigs.k8s.io/yaml v1.3.0 // indirect

+ 4 - 7
core/go.sum

@@ -142,7 +142,6 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2
 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
 github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
 github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
-github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
 github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
 github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
 github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
@@ -374,7 +373,6 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb
 github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
 github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
 github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
-github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
 github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
 github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
 github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng=
@@ -819,11 +817,10 @@ k8s.io/api v0.25.3 h1:Q1v5UFfYe87vi5H7NU0p4RXC26PPMT8KOpr1TLQbCMQ=
 k8s.io/api v0.25.3/go.mod h1:o42gKscFrEVjHdQnyRenACrMtbuJsVdP+WVjqejfzmI=
 k8s.io/apimachinery v0.25.3 h1:7o9ium4uyUOM76t6aunP0nZuex7gDf8VGwkR5RcJnQc=
 k8s.io/apimachinery v0.25.3/go.mod h1:jaF9C/iPNM1FuLl7Zuy5b9v+n35HGSh6AQ4HYRkCqwo=
-k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
-k8s.io/klog/v2 v2.80.0 h1:lyJt0TWMPaGoODa8B8bUuxgHS3W/m/bNr2cca3brA/g=
-k8s.io/klog/v2 v2.80.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4=
-k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
+k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4=
+k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
+k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e h1:KqK5c/ghOm8xkHYhlodbp6i6+r+ChV2vuAuVRdFbLro=
+k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
 rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
 rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
 rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

+ 408 - 0
core/pkg/clustercache/clustercache.go

@@ -0,0 +1,408 @@
+package clustercache
+
+import (
+	"time"
+
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	"k8s.io/apimachinery/pkg/types"
+	"k8s.io/utils/ptr"
+
+	appsv1 "k8s.io/api/apps/v1"
+	batchv1 "k8s.io/api/batch/v1"
+	v1 "k8s.io/api/core/v1"
+	policyv1 "k8s.io/api/policy/v1"
+	stv1 "k8s.io/api/storage/v1"
+)
+
+type Namespace struct {
+	Name        string
+	Labels      map[string]string
+	Annotations map[string]string
+}
+
+type Pod struct {
+	UID               types.UID
+	Name              string
+	Namespace         string
+	Labels            map[string]string
+	Annotations       map[string]string
+	OwnerReferences   []metav1.OwnerReference
+	Status            PodStatus
+	Spec              PodSpec
+	DeletionTimestamp *time.Time
+}
+
+type PodStatus struct {
+	Phase             v1.PodPhase
+	ContainerStatuses []v1.ContainerStatus
+}
+
+type PodSpec struct {
+	NodeName      string
+	Containers    []Container
+	Volumes       []v1.Volume
+	RestartPolicy v1.RestartPolicy
+}
+
+type Container struct {
+	Name      string
+	Resources v1.ResourceRequirements
+}
+
+type Node struct {
+	Name           string
+	Labels         map[string]string
+	Annotations    map[string]string
+	Status         v1.NodeStatus
+	SpecProviderID string
+}
+
+type Service struct {
+	Name         string
+	Namespace    string
+	SpecSelector map[string]string
+	Type         v1.ServiceType
+	Status       v1.ServiceStatus
+}
+
+type DaemonSet struct {
+	Name           string
+	Namespace      string
+	Labels         map[string]string
+	SpecContainers []v1.Container
+}
+
+type Deployment struct {
+	Name                    string
+	Namespace               string
+	Labels                  map[string]string
+	Annotations             map[string]string
+	MatchLabels             map[string]string
+	SpecSelector            *metav1.LabelSelector
+	SpecReplicas            *int32
+	SpecStrategy            appsv1.DeploymentStrategy
+	StatusAvailableReplicas int32
+	PodSpec                 PodSpec
+}
+
+type StatefulSet struct {
+	Name         string
+	Namespace    string
+	Labels       map[string]string
+	Annotations  map[string]string
+	SpecSelector *metav1.LabelSelector
+	SpecReplicas *int32
+	PodSpec      PodSpec
+}
+
+type PersistentVolumeClaim struct {
+	Name        string
+	Namespace   string
+	Spec        v1.PersistentVolumeClaimSpec
+	Labels      map[string]string
+	Annotations map[string]string
+}
+
+type StorageClass struct {
+	Name        string
+	Labels      map[string]string
+	Annotations map[string]string
+	Parameters  map[string]string
+	Provisioner string
+	TypeMeta    metav1.TypeMeta
+	Size        int
+}
+
+type Job struct {
+	Name      string
+	Namespace string
+	Status    batchv1.JobStatus
+}
+
+type PersistentVolume struct {
+	Name        string
+	Namespace   string
+	Labels      map[string]string
+	Annotations map[string]string
+	Spec        v1.PersistentVolumeSpec
+	Status      v1.PersistentVolumeStatus
+}
+
+type ReplicationController struct {
+	Name      string
+	Namespace string
+	Spec      v1.ReplicationControllerSpec
+}
+
+type PodDisruptionBudget struct {
+	Name      string
+	Namespace string
+	Spec      policyv1.PodDisruptionBudgetSpec
+	Status    policyv1.PodDisruptionBudgetStatus
+}
+
+type ReplicaSet struct {
+	Name         string
+	Namespace    string
+	SpecSelector *metav1.LabelSelector
+	Spec         appsv1.ReplicaSetSpec
+}
+
+type Volume struct {
+}
+
+// GetControllerOf returns a pointer to a copy of the controllerRef if controllee has a controller
+func GetControllerOf(pod *Pod) *metav1.OwnerReference {
+	ref := GetControllerOfNoCopy(pod)
+	if ref == nil {
+		return nil
+	}
+	cp := *ref
+	cp.Controller = ptr.To(*ref.Controller)
+	if ref.BlockOwnerDeletion != nil {
+		cp.BlockOwnerDeletion = ptr.To(*ref.BlockOwnerDeletion)
+	}
+	return &cp
+}
+
+// GetControllerOfNoCopy returns a pointer to the controllerRef if controllee has a controller
+func GetControllerOfNoCopy(pod *Pod) *metav1.OwnerReference {
+	refs := pod.OwnerReferences
+	for i := range refs {
+		if refs[i].Controller != nil && *refs[i].Controller {
+			return &refs[i]
+		}
+	}
+	return nil
+}
+
+func TransformNamespace(input *v1.Namespace) *Namespace {
+	return &Namespace{
+		Name:        input.Name,
+		Annotations: input.Annotations,
+		Labels:      input.Labels,
+	}
+}
+
+func TransformPodContainer(input v1.Container) Container {
+	return Container{
+		Name:      input.Name,
+		Resources: input.Resources,
+	}
+}
+
+func TransformPodStatus(input v1.PodStatus) PodStatus {
+	return PodStatus{
+		Phase:             input.Phase,
+		ContainerStatuses: input.ContainerStatuses,
+	}
+}
+
+func TransformPodSpec(input v1.PodSpec) PodSpec {
+	containers := make([]Container, len(input.Containers))
+	for i, container := range input.Containers {
+		containers[i] = TransformPodContainer(container)
+	}
+	return PodSpec{
+		NodeName:      input.NodeName,
+		Containers:    containers,
+		Volumes:       input.Volumes,
+		RestartPolicy: input.RestartPolicy,
+	}
+
+}
+
+func TransformTimestamp(input *metav1.Time) *time.Time {
+	if input == nil {
+		return nil
+	}
+
+	t := input.Time
+	return &t
+}
+
+func TransformPod(input *v1.Pod) *Pod {
+	return &Pod{
+		UID:               input.UID,
+		Name:              input.Name,
+		Namespace:         input.Namespace,
+		Labels:            input.Labels,
+		Annotations:       input.Annotations,
+		OwnerReferences:   input.OwnerReferences,
+		Spec:              TransformPodSpec(input.Spec),
+		Status:            TransformPodStatus(input.Status),
+		DeletionTimestamp: TransformTimestamp(input.DeletionTimestamp),
+	}
+}
+
+func TransformNode(input *v1.Node) *Node {
+	return &Node{
+		Name:           input.Name,
+		Labels:         input.Labels,
+		Annotations:    input.Annotations,
+		Status:         input.Status,
+		SpecProviderID: input.Spec.ProviderID,
+	}
+}
+
+func TransformService(input *v1.Service) *Service {
+	return &Service{
+		Name:         input.Name,
+		Namespace:    input.Namespace,
+		SpecSelector: input.Spec.Selector,
+		Type:         input.Spec.Type,
+		Status:       input.Status,
+	}
+}
+
+func TransformDaemonSet(input *appsv1.DaemonSet) *DaemonSet {
+	return &DaemonSet{
+		Name:           input.Name,
+		Namespace:      input.Namespace,
+		Labels:         input.Labels,
+		SpecContainers: input.Spec.Template.Spec.Containers,
+	}
+}
+
+func TransformDeployment(input *appsv1.Deployment) *Deployment {
+	return &Deployment{
+		Name:                    input.Name,
+		Namespace:               input.Namespace,
+		Labels:                  input.Labels,
+		MatchLabels:             input.Spec.Selector.MatchLabels,
+		SpecReplicas:            input.Spec.Replicas,
+		SpecSelector:            input.Spec.Selector,
+		SpecStrategy:            input.Spec.Strategy,
+		StatusAvailableReplicas: input.Status.AvailableReplicas,
+		PodSpec:                 TransformPodSpec(input.Spec.Template.Spec),
+	}
+}
+
+func TransformStatefulSet(input *appsv1.StatefulSet) *StatefulSet {
+	return &StatefulSet{
+		Name:         input.Name,
+		Namespace:    input.Namespace,
+		SpecSelector: input.Spec.Selector,
+		SpecReplicas: input.Spec.Replicas,
+		PodSpec:      TransformPodSpec(input.Spec.Template.Spec),
+	}
+}
+
+func TransformPersistentVolume(input *v1.PersistentVolume) *PersistentVolume {
+	return &PersistentVolume{
+		Name:        input.Name,
+		Namespace:   input.Namespace,
+		Labels:      input.Labels,
+		Annotations: input.Annotations,
+		Spec:        input.Spec,
+		Status:      input.Status,
+	}
+}
+
+func TransformPersistentVolumeClaim(input *v1.PersistentVolumeClaim) *PersistentVolumeClaim {
+	return &PersistentVolumeClaim{
+		Name:        input.Name,
+		Namespace:   input.Namespace,
+		Spec:        input.Spec,
+		Labels:      input.Labels,
+		Annotations: input.Annotations,
+	}
+}
+
+func TransformStorageClass(input *stv1.StorageClass) *StorageClass {
+	return &StorageClass{
+		Name:        input.Name,
+		Annotations: input.Annotations,
+		Labels:      input.Labels,
+		Parameters:  input.Parameters,
+		Provisioner: input.Provisioner,
+		TypeMeta:    input.TypeMeta,
+		Size:        input.Size(),
+	}
+}
+
+func TransformJob(input *batchv1.Job) *Job {
+	return &Job{
+		Name:      input.Name,
+		Namespace: input.Namespace,
+		Status:    input.Status,
+	}
+}
+
+func TransformReplicationController(input *v1.ReplicationController) *ReplicationController {
+	return &ReplicationController{
+		Name:      input.Name,
+		Namespace: input.Namespace,
+		Spec:      input.Spec,
+	}
+}
+
+func TransformPodDisruptionBudget(input *policyv1.PodDisruptionBudget) *PodDisruptionBudget {
+	return &PodDisruptionBudget{
+		Name:      input.Name,
+		Namespace: input.Namespace,
+		Spec:      input.Spec,
+		Status:    input.Status,
+	}
+}
+
+func TransformReplicaSet(input *appsv1.ReplicaSet) *ReplicaSet {
+	return &ReplicaSet{
+		Name:         input.Name,
+		Namespace:    input.Namespace,
+		Spec:         input.Spec,
+		SpecSelector: input.Spec.Selector,
+	}
+}
+
+// ClusterCache defines an contract for an object which caches components within a cluster, ensuring
+// up to date resources using watchers
+type ClusterCache interface {
+	// Run starts the watcher processes
+	Run()
+
+	// Stops the watcher processes
+	Stop()
+
+	// GetAllNamespaces returns all the cached namespaces
+	GetAllNamespaces() []*Namespace
+
+	// GetAllNodes returns all the cached nodes
+	GetAllNodes() []*Node
+
+	// GetAllPods returns all the cached pods
+	GetAllPods() []*Pod
+
+	// GetAllServices returns all the cached services
+	GetAllServices() []*Service
+
+	// GetAllDaemonSets returns all the cached DaemonSets
+	GetAllDaemonSets() []*DaemonSet
+
+	// GetAllDeployments returns all the cached deployments
+	GetAllDeployments() []*Deployment
+
+	// GetAllStatfulSets returns all the cached StatefulSets
+	GetAllStatefulSets() []*StatefulSet
+
+	// GetAllReplicaSets returns all the cached ReplicaSets
+	GetAllReplicaSets() []*ReplicaSet
+
+	// GetAllPersistentVolumes returns all the cached persistent volumes
+	GetAllPersistentVolumes() []*PersistentVolume
+
+	// GetAllPersistentVolumeClaims returns all the cached persistent volume claims
+	GetAllPersistentVolumeClaims() []*PersistentVolumeClaim
+
+	// GetAllStorageClasses returns all the cached storage classes
+	GetAllStorageClasses() []*StorageClass
+
+	// GetAllJobs returns all the cached jobs
+	GetAllJobs() []*Job
+
+	// GetAllPodDisruptionBudgets returns all cached pod disruption budgets
+	GetAllPodDisruptionBudgets() []*PodDisruptionBudget
+
+	// GetAllReplicationControllers returns all cached replication controllers
+	GetAllReplicationControllers() []*ReplicationController
+}

+ 1 - 1
go.mod

@@ -192,7 +192,7 @@ require (
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 	k8s.io/klog/v2 v2.130.1 // indirect
 	k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
-	k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
+	k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e // indirect
 	sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
 	sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
 )

+ 2 - 2
go.sum

@@ -1007,8 +1007,8 @@ k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
 k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
 k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y=
 k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4=
-k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=
-k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e h1:KqK5c/ghOm8xkHYhlodbp6i6+r+ChV2vuAuVRdFbLro=
+k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
 rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
 rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
 rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

+ 2 - 58
modules/collector-source/go.mod

@@ -5,7 +5,6 @@ replace github.com/opencost/opencost/core => ./../../core
 go 1.23.0
 
 require (
-	github.com/opencost/opencost v1.114.0
 	github.com/opencost/opencost/core v0.0.0-00010101000000-000000000000
 	golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0
 	k8s.io/api v0.32.3
@@ -14,103 +13,48 @@ require (
 )
 
 require (
-	cloud.google.com/go v0.114.0 // indirect
-	cloud.google.com/go/auth v0.5.1 // indirect
-	cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect
-	cloud.google.com/go/compute/metadata v0.3.0 // indirect
-	cloud.google.com/go/iam v1.1.8 // indirect
-	cloud.google.com/go/storage v1.42.0 // indirect
-	github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 // indirect
-	github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 // indirect
-	github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
-	github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.0 // indirect
-	github.com/AzureAD/microsoft-authentication-library-for-go v1.3.3 // indirect
-	github.com/aws/aws-sdk-go-v2 v1.36.3 // indirect
-	github.com/aws/aws-sdk-go-v2/config v1.29.10 // indirect
-	github.com/aws/aws-sdk-go-v2/credentials v1.17.63 // indirect
-	github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 // indirect
-	github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 // indirect
-	github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 // indirect
-	github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
-	github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 // indirect
-	github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15 // indirect
-	github.com/aws/aws-sdk-go-v2/service/sso v1.25.1 // indirect
-	github.com/aws/aws-sdk-go-v2/service/ssooidc v1.29.2 // indirect
-	github.com/aws/aws-sdk-go-v2/service/sts v1.33.17 // indirect
-	github.com/aws/smithy-go v1.22.2 // indirect
 	github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
-	github.com/dustin/go-humanize v1.0.1 // indirect
 	github.com/emicklei/go-restful/v3 v3.11.0 // indirect
-	github.com/felixge/httpsnoop v1.0.4 // indirect
 	github.com/fsnotify/fsnotify v1.6.0 // indirect
 	github.com/fxamacker/cbor/v2 v2.7.0 // indirect
-	github.com/go-ini/ini v1.67.0 // indirect
 	github.com/go-logr/logr v1.4.2 // indirect
-	github.com/go-logr/stdr v1.2.2 // indirect
 	github.com/go-openapi/jsonpointer v0.21.0 // indirect
 	github.com/go-openapi/jsonreference v0.20.2 // indirect
 	github.com/go-openapi/swag v0.23.0 // indirect
 	github.com/goccy/go-json v0.10.5 // indirect
 	github.com/gogo/protobuf v1.3.2 // indirect
-	github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
-	github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
 	github.com/golang/protobuf v1.5.4 // indirect
 	github.com/google/gnostic-models v0.6.8 // indirect
 	github.com/google/go-cmp v0.7.0 // indirect
 	github.com/google/gofuzz v1.2.0 // indirect
-	github.com/google/s2a-go v0.1.7 // indirect
 	github.com/google/uuid v1.6.0 // indirect
-	github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
-	github.com/googleapis/gax-go/v2 v2.12.4 // indirect
 	github.com/hashicorp/hcl v1.0.0 // indirect
 	github.com/josharian/intern v1.0.0 // indirect
 	github.com/json-iterator/go v1.1.12 // indirect
 	github.com/julienschmidt/httprouter v1.3.0 // indirect
-	github.com/klauspost/compress v1.17.11 // indirect
-	github.com/klauspost/cpuid/v2 v2.2.9 // indirect
-	github.com/kylelemons/godebug v1.1.0 // indirect
 	github.com/magiconair/properties v1.8.5 // indirect
 	github.com/mailru/easyjson v0.7.7 // indirect
-	github.com/minio/crc64nvme v1.0.1 // indirect
-	github.com/minio/md5-simd v1.1.2 // indirect
-	github.com/minio/minio-go/v7 v7.0.88 // indirect
 	github.com/mitchellh/mapstructure v1.5.0 // indirect
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/modern-go/reflect2 v1.0.2 // indirect
 	github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
 	github.com/pelletier/go-toml v1.9.3 // indirect
-	github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
 	github.com/pkg/errors v0.9.1 // indirect
-	github.com/prometheus/client_model v0.6.1 // indirect
-	github.com/prometheus/common v0.63.0 // indirect
-	github.com/rs/xid v1.6.0 // indirect
 	github.com/rs/zerolog v1.26.1 // indirect
 	github.com/spf13/afero v1.6.0 // indirect
 	github.com/spf13/cast v1.3.1 // indirect
 	github.com/spf13/jwalterweatherman v1.1.0 // indirect
 	github.com/spf13/pflag v1.0.5 // indirect
 	github.com/spf13/viper v1.8.1 // indirect
+	github.com/stretchr/testify v1.10.0 // indirect
 	github.com/subosito/gotenv v1.2.0 // indirect
 	github.com/x448/float16 v0.8.4 // indirect
-	go.opencensus.io v0.24.0 // indirect
-	go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
-	go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
-	go.opentelemetry.io/otel v1.24.0 // indirect
-	go.opentelemetry.io/otel/metric v1.24.0 // indirect
-	go.opentelemetry.io/otel/trace v1.24.0 // indirect
-	golang.org/x/crypto v0.36.0 // indirect
 	golang.org/x/net v0.37.0 // indirect
 	golang.org/x/oauth2 v0.25.0 // indirect
-	golang.org/x/sync v0.13.0 // indirect
 	golang.org/x/sys v0.31.0 // indirect
 	golang.org/x/term v0.30.0 // indirect
 	golang.org/x/text v0.23.0 // indirect
 	golang.org/x/time v0.7.0 // indirect
-	google.golang.org/api v0.183.0 // indirect
-	google.golang.org/genproto v0.0.0-20240528184218-531527333157 // indirect
-	google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect
-	google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
-	google.golang.org/grpc v1.64.1 // indirect
 	google.golang.org/protobuf v1.36.5 // indirect
 	gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
 	gopkg.in/inf.v0 v0.9.1 // indirect
@@ -119,7 +63,7 @@ require (
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 	k8s.io/klog/v2 v2.130.1 // indirect
 	k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
-	k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
+	k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e // indirect
 	sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
 	sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
 	sigs.k8s.io/yaml v1.4.0 // indirect

+ 2 - 143
modules/collector-source/go.sum

@@ -18,27 +18,15 @@ cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmW
 cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
 cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
 cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
-cloud.google.com/go v0.114.0 h1:OIPFAdfrFDFO2ve2U7r/H5SwSbBzEdrBdE7xkgwc+kY=
-cloud.google.com/go v0.114.0/go.mod h1:ZV9La5YYxctro1HTPug5lXH/GefROyW8PPD4T8n9J8E=
-cloud.google.com/go/auth v0.5.1 h1:0QNO7VThG54LUzKiQxv8C6x1YX7lUrzlAa1nVLF8CIw=
-cloud.google.com/go/auth v0.5.1/go.mod h1:vbZT8GjzDf3AVqCcQmqeeM32U9HBFc32vVVAbwDsa6s=
-cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4=
-cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q=
 cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
 cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
 cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
 cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
 cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
 cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
-cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=
-cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
 cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
 cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
 cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
-cloud.google.com/go/iam v1.1.8 h1:r7umDwhj+BQyz0ScZMp4QrGXjSTI3ZINnpgU2nlB/K0=
-cloud.google.com/go/iam v1.1.8/go.mod h1:GvE6lyMmfxXauzNq8NbgJbeVQNspG+tcdL/W8QO1+zE=
-cloud.google.com/go/longrunning v0.5.7 h1:WLbHekDbjK1fVFD3ibpFFVoyizlLRl73I7YKuAKilhU=
-cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodEMwEAztp38Xng=
 cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
 cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
 cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
@@ -48,63 +36,16 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
 cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
 cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
 cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
-cloud.google.com/go/storage v1.42.0 h1:4QtGpplCVt1wz6g5o1ifXd656P5z+yNgzdw1tVfp0cU=
-cloud.google.com/go/storage v1.42.0/go.mod h1:HjMXRFq65pGKFn6hxj6x3HCyR41uSB72Z0SO/Vn6JFQ=
 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
-github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU=
-github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 h1:DSDNVxqkoXJiko6x8a90zidoYqnYYa6c1MTzDKzKkTo=
-github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1/go.mod h1:zGqV2R4Cr/k8Uye5w+dgQ06WJtEcbQG/8J7BB6hnCr4=
-github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 h1:F0gBpfdPLGsw+nsgk6aqqkZS1jiixa5WwFe3fk/T3Ys=
-github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2/go.mod h1:SqINnQ9lVVdRlyC8cd1lCI0SdX4n2paeABd2K8ggfnE=
-github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY=
-github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8=
-github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY=
-github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY=
-github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0 h1:PiSrjRPpkQNjrM8H0WwKMnZUdu1RGMtd/LdGKUrOo+c=
-github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0/go.mod h1:oDrbWx4ewMylP7xHivfgixbfGBT6APAwsSoHRKotnIc=
-github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.0 h1:UXT0o77lXQrikd1kgwIPQOUect7EoR/+sbP4wQKdzxM=
-github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.0/go.mod h1:cTvi54pg19DoT07ekoeMgE/taAwNtCShVeZqA+Iv2xI=
-github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM=
-github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE=
-github.com/AzureAD/microsoft-authentication-library-for-go v1.3.3 h1:H5xDQaE3XowWfhZRUpnfC+rGZMEVoSiji+b+/HFAPU4=
-github.com/AzureAD/microsoft-authentication-library-for-go v1.3.3/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
 github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
 github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
 github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
 github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
-github.com/aws/aws-sdk-go-v2 v1.36.3 h1:mJoei2CxPutQVxaATCzDUjcZEjVRdpsiiXi2o38yqWM=
-github.com/aws/aws-sdk-go-v2 v1.36.3/go.mod h1:LLXuLpgzEbD766Z5ECcRmi8AzSwfZItDtmABVkRLGzg=
-github.com/aws/aws-sdk-go-v2/config v1.29.10 h1:yNjgjiGBp4GgaJrGythyBXg2wAs+Im9fSWIUwvi1CAc=
-github.com/aws/aws-sdk-go-v2/config v1.29.10/go.mod h1:A0mbLXSdtob/2t59n1X0iMkPQ5d+YzYZB4rwu7SZ7aA=
-github.com/aws/aws-sdk-go-v2/credentials v1.17.63 h1:rv1V3kIJ14pdmTu01hwcMJ0WAERensSiD9rEWEBb1Tk=
-github.com/aws/aws-sdk-go-v2/credentials v1.17.63/go.mod h1:EJj+yDf0txT26Ulo0VWTavBl31hOsaeuMxIHu2m0suY=
-github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 h1:x793wxmUWVDhshP8WW2mlnXuFrO4cOd3HLBroh1paFw=
-github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30/go.mod h1:Jpne2tDnYiFascUEs2AWHJL9Yp7A5ZVy3TNyxaAjD6M=
-github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 h1:ZK5jHhnrioRkUNOc+hOgQKlUL5JeC3S6JgLxtQ+Rm0Q=
-github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34/go.mod h1:p4VfIceZokChbA9FzMbRGz5OV+lekcVtHlPKEO0gSZY=
-github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 h1:SZwFm17ZUNNg5Np0ioo/gq8Mn6u9w19Mri8DnJ15Jf0=
-github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34/go.mod h1:dFZsC0BLo346mvKQLWmoJxT+Sjp+qcVR1tRVHQGOH9Q=
-github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo=
-github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo=
-github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 h1:eAh2A4b5IzM/lum78bZ590jy36+d/aFLgKF/4Vd1xPE=
-github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3/go.mod h1:0yKJC/kb8sAnmlYa6Zs3QVYqaC8ug2AbnNChv5Ox3uA=
-github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15 h1:dM9/92u2F1JbDaGooxTq18wmmFzbJRfXfVfy96/1CXM=
-github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15/go.mod h1:SwFBy2vjtA0vZbjjaFtfN045boopadnoVPhu4Fv66vY=
-github.com/aws/aws-sdk-go-v2/service/sso v1.25.1 h1:8JdC7Gr9NROg1Rusk25IcZeTO59zLxsKgE0gkh5O6h0=
-github.com/aws/aws-sdk-go-v2/service/sso v1.25.1/go.mod h1:qs4a9T5EMLl/Cajiw2TcbNt2UNo/Hqlyp+GiuG4CFDI=
-github.com/aws/aws-sdk-go-v2/service/ssooidc v1.29.2 h1:wK8O+j2dOolmpNVY1EWIbLgxrGCHJKVPm08Hv/u80M8=
-github.com/aws/aws-sdk-go-v2/service/ssooidc v1.29.2/go.mod h1:MlYRNmYu/fGPoxBQVvBYr9nyr948aY/WLUvwBMBJubs=
-github.com/aws/aws-sdk-go-v2/service/sts v1.33.17 h1:PZV5W8yk4OtH1JAuhV2PXwwO9v5G5Aoj+eMCn4T+1Kc=
-github.com/aws/aws-sdk-go-v2/service/sts v1.33.17/go.mod h1:cQnB8CUnxbMU82JvlqjKR2HBOm3fe9pWorWBza6MBJ4=
-github.com/aws/smithy-go v1.22.2 h1:6D9hW43xKFrRx/tXXfAlIZc4JI+yQe6snnWcQyxSyLQ=
-github.com/aws/smithy-go v1.22.2/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
 github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
 github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
-github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
-github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
 github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
 github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
@@ -119,10 +60,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
-github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
-github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
-github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
 github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
 github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
 github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -133,8 +70,6 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m
 github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
 github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
-github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
-github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
 github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
 github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
 github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
@@ -144,13 +79,8 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME
 github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
-github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
-github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
-github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
 github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
 github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
-github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
-github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
 github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
 github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
 github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
@@ -166,14 +96,10 @@ github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PU
 github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
 github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
 github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
-github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
-github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
-github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
 github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
 github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
@@ -222,12 +148,9 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX
 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
 github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
 github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
 github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
 github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
 github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
-github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc=
-github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0=
 github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
 github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
 github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
@@ -242,17 +165,11 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe
 github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo=
 github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
 github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
-github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
-github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
 github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
 github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs=
-github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
 github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
 github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
-github.com/googleapis/gax-go/v2 v2.12.4 h1:9gWcmF85Wvq4ryPFvGFaOgPIs1AQX0d0bcbGw4Z96qg=
-github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI=
 github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
 github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
 github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
@@ -288,15 +205,8 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X
 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
 github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
 github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
-github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs=
-github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6/go.mod h1:3VeWNIJaW+O5xpRQbPp0Ybqu1vJd/pm7s2F473HRrkw=
 github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
-github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
-github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
-github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY=
-github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8=
 github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
 github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
 github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
@@ -306,8 +216,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
 github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
 github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
 github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
-github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
 github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
 github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
 github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
@@ -315,12 +223,6 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ
 github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
 github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
 github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
-github.com/minio/crc64nvme v1.0.1 h1:DHQPrYPdqK7jQG/Ls5CTBZWeex/2FMS3G5XGkycuFrY=
-github.com/minio/crc64nvme v1.0.1/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg=
-github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
-github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
-github.com/minio/minio-go/v7 v7.0.88 h1:v8MoIJjwYxOkehp+eiLIuvXk87P2raUtoU5klrAAshs=
-github.com/minio/minio-go/v7 v7.0.88/go.mod h1:33+O8h0tO7pCeCWwBVa07RhVVfB/3vS4kEX7rwYKmIg=
 github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
 github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
 github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
@@ -344,13 +246,9 @@ github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM
 github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
 github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=
 github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
-github.com/opencost/opencost v1.114.0 h1:eR2RBzMhtfBGyco1z6ZofvCHfj+pzz9LgtKWZEKBGGo=
-github.com/opencost/opencost v1.114.0/go.mod h1:wjcc9kpG2jGjLnxsb5jDTNZWKF7waEQWeS4niMhpQO4=
 github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
 github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ=
 github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
-github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
-github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
 github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
 github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -360,19 +258,11 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
 github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
 github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
-github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
-github.com/prometheus/common v0.63.0 h1:YR/EIY1o3mEFP/kZCD7iDMnLPlGyuU2Gb3HIcXnA98k=
-github.com/prometheus/common v0.63.0/go.mod h1:VVFF/fBIoToEnWRVkYoXEkq3R3paCoxG9PXP74SnV18=
-github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E=
-github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw=
 github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
 github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
 github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
 github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
 github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
-github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU=
-github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
 github.com/rs/zerolog v1.26.1 h1:/ihwxqH+4z8UxyI70wM1z9yCvkWcfz/a3mj48k/Zngc=
 github.com/rs/zerolog v1.26.1/go.mod h1:/wSSJWX7lVrsOwlbyTRSOJvqRlc+WjWlfes+CiJ+tmc=
 github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
@@ -423,20 +313,6 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
 go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
-go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
-go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
-go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
-go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
-go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
-go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
-go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
-go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
-go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
-go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
 go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
 go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
 go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
@@ -448,8 +324,6 @@ golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8U
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
-golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
-golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -551,8 +425,6 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
-golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
 golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -597,7 +469,6 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
 golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
@@ -676,8 +547,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
-golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
 google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
 google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
 google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
@@ -700,8 +569,6 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR
 google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
 google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
 google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8=
-google.golang.org/api v0.183.0 h1:PNMeRDwo1pJdgNcFQ9GstuLe/noWKIc89pRWRLMvLwE=
-google.golang.org/api v0.183.0/go.mod h1:q43adC5/pHoSZTx5h2mSmdF7NcyfW9JuDyIOJAgS9ZQ=
 google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
 google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -750,12 +617,6 @@ google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6D
 google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
 google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
-google.golang.org/genproto v0.0.0-20240528184218-531527333157 h1:u7WMYrIrVvs0TF5yaKwKNbcJyySYf+HAIFXxWltJOXE=
-google.golang.org/genproto v0.0.0-20240528184218-531527333157/go.mod h1:ubQlAQnzejB8uZzszhrTCU2Fyp6Vi7ZE5nn0c3W8+qQ=
-google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 h1:+rdxYoE3E5htTEWIe15GlN6IfvbURM//Jt0mmkmm6ZU=
-google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117/go.mod h1:OimBR/bc1wPO9iV4NC2bpyjy3VnAwZh5EBPQdtaE5oo=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
 google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
 google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
 google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
@@ -776,8 +637,6 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG
 google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
 google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
 google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
-google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA=
-google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0=
 google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
 google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
 google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -830,8 +689,8 @@ k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
 k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
 k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y=
 k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4=
-k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=
-k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e h1:KqK5c/ghOm8xkHYhlodbp6i6+r+ChV2vuAuVRdFbLro=
+k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
 rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
 rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
 rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

+ 1 - 1
modules/collector-source/pkg/collector/scraper.go

@@ -6,9 +6,9 @@ import (
 	"strings"
 	"time"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/log"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"golang.org/x/exp/maps"
 	v1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/api/resource"

+ 1 - 1
modules/collector-source/pkg/collector/scraper_test.go

@@ -4,7 +4,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opencost/opencost/pkg/clustercache"
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	v1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/api/resource"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

+ 1 - 1
modules/prometheus-source/go.mod

@@ -53,7 +53,7 @@ require (
 	k8s.io/api v0.32.0 // indirect
 	k8s.io/apimachinery v0.32.0 // indirect
 	k8s.io/klog/v2 v2.130.1 // indirect
-	k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
+	k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e // indirect
 	sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
 	sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
 	sigs.k8s.io/yaml v1.4.0 // indirect

+ 2 - 2
modules/prometheus-source/go.sum

@@ -683,8 +683,8 @@ k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
 k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
 k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y=
 k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4=
-k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=
-k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e h1:KqK5c/ghOm8xkHYhlodbp6i6+r+ChV2vuAuVRdFbLro=
+k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
 rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
 rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
 rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

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

@@ -14,6 +14,7 @@ import (
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
 	"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/clustercache"
 	"github.com/opencost/opencost/core/pkg/env"
 	"github.com/opencost/opencost/core/pkg/log"
 	"github.com/opencost/opencost/core/pkg/opencost"
@@ -22,7 +23,6 @@ import (
 	"github.com/opencost/opencost/core/pkg/util/stringutil"
 	"github.com/opencost/opencost/pkg/cloud/models"
 	"github.com/opencost/opencost/pkg/cloud/utils"
-	"github.com/opencost/opencost/pkg/clustercache"
 
 	ocenv "github.com/opencost/opencost/pkg/env"
 	"golang.org/x/exp/slices"

+ 1 - 1
pkg/cloud/alibaba/provider_test.go

@@ -7,8 +7,8 @@ import (
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers"
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/cloud/models"
-	"github.com/opencost/opencost/pkg/clustercache"
 	v1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/api/resource"
 )

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

@@ -20,6 +20,7 @@ import (
 	"github.com/opencost/opencost/pkg/cloud/models"
 	"github.com/opencost/opencost/pkg/cloud/utils"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/env"
 	errs "github.com/opencost/opencost/core/pkg/errors"
 	"github.com/opencost/opencost/core/pkg/log"
@@ -28,7 +29,6 @@ import (
 	"github.com/opencost/opencost/core/pkg/util/fileutil"
 	"github.com/opencost/opencost/core/pkg/util/json"
 	"github.com/opencost/opencost/core/pkg/util/timeutil"
-	"github.com/opencost/opencost/pkg/clustercache"
 	ocenv "github.com/opencost/opencost/pkg/env"
 
 	awsSDK "github.com/aws/aws-sdk-go-v2/aws"

+ 1 - 1
pkg/cloud/aws/provider_test.go

@@ -9,8 +9,8 @@ import (
 	"reflect"
 	"testing"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/cloud/models"
-	"github.com/opencost/opencost/pkg/clustercache"
 	v1 "k8s.io/api/core/v1"
 )
 

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

@@ -21,6 +21,7 @@ import (
 	"github.com/Azure/go-autorest/autorest/azure"
 	"github.com/Azure/go-autorest/autorest/azure/auth"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/log"
 	"github.com/opencost/opencost/core/pkg/opencost"
 	"github.com/opencost/opencost/core/pkg/util"
@@ -29,7 +30,6 @@ import (
 	"github.com/opencost/opencost/core/pkg/util/timeutil"
 	"github.com/opencost/opencost/pkg/cloud/models"
 	"github.com/opencost/opencost/pkg/cloud/utils"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/env"
 )
 

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

@@ -18,13 +18,13 @@ import (
 	"github.com/opencost/opencost/pkg/cloud/models"
 	"github.com/opencost/opencost/pkg/cloud/utils"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"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"
 	"github.com/opencost/opencost/core/pkg/util/timeutil"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/env"
 	"github.com/rs/zerolog"
 

+ 1 - 1
pkg/cloud/models/models.go

@@ -9,8 +9,8 @@ import (
 	"strings"
 
 	"github.com/microcosm-cc/bluemonday"
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/log"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/config"
 )
 

+ 1 - 1
pkg/cloud/oracle/provider.go

@@ -6,13 +6,13 @@ import (
 	"strconv"
 	"sync"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"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"
 	"github.com/opencost/opencost/pkg/cloud/utils"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/env"
 )
 

+ 1 - 1
pkg/cloud/oracle/provider_test.go

@@ -6,7 +6,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opencost/opencost/pkg/clustercache"
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/stretchr/testify/assert"
 	v1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/api/resource"

+ 1 - 1
pkg/cloud/otc/provider.go

@@ -9,11 +9,11 @@ import (
 	"strings"
 	"sync"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"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/pkg/cloud/models"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/env"
 )
 

+ 1 - 1
pkg/cloud/provider/csvprovider.go

@@ -11,9 +11,9 @@ import (
 	"sync"
 	"time"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/util"
 	"github.com/opencost/opencost/pkg/cloud/models"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/env"
 
 	"github.com/aws/aws-sdk-go/aws"

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

@@ -7,13 +7,13 @@ import (
 	"strconv"
 	"sync"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"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"
 	"github.com/opencost/opencost/pkg/cloud/utils"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/env"
 )
 

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

@@ -26,9 +26,9 @@ import (
 
 	"cloud.google.com/go/compute/metadata"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/log"
 	"github.com/opencost/opencost/core/pkg/util/httputil"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/config"
 	"github.com/opencost/opencost/pkg/env"
 	"github.com/opencost/opencost/pkg/util/watcher"

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

@@ -11,10 +11,10 @@ import (
 	"github.com/opencost/opencost/pkg/cloud/models"
 	"github.com/opencost/opencost/pkg/cloud/utils"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"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"
 	"github.com/opencost/opencost/pkg/env"
 
 	"github.com/opencost/opencost/core/pkg/log"

+ 45 - 441
pkg/clustercache/clustercache.go

@@ -2,13 +2,10 @@ package clustercache
 
 import (
 	"sync"
-	"time"
 
+	cc "github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/log"
 	"github.com/opencost/opencost/pkg/env"
-	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-	"k8s.io/apimachinery/pkg/types"
-	"k8s.io/utils/ptr"
 
 	appsv1 "k8s.io/api/apps/v1"
 	batchv1 "k8s.io/api/batch/v1"
@@ -19,399 +16,6 @@ import (
 	"k8s.io/client-go/kubernetes"
 )
 
-type Namespace struct {
-	Name        string
-	Labels      map[string]string
-	Annotations map[string]string
-}
-
-type Pod struct {
-	UID               types.UID
-	Name              string
-	Namespace         string
-	Labels            map[string]string
-	Annotations       map[string]string
-	OwnerReferences   []metav1.OwnerReference
-	Status            PodStatus
-	Spec              PodSpec
-	DeletionTimestamp *time.Time
-}
-
-type PodStatus struct {
-	Phase             v1.PodPhase
-	ContainerStatuses []v1.ContainerStatus
-}
-
-type PodSpec struct {
-	NodeName      string
-	Containers    []Container
-	Volumes       []v1.Volume
-	RestartPolicy v1.RestartPolicy
-}
-
-type Container struct {
-	Name      string
-	Resources v1.ResourceRequirements
-}
-
-type Node struct {
-	Name           string
-	Labels         map[string]string
-	Annotations    map[string]string
-	Status         v1.NodeStatus
-	SpecProviderID string
-}
-
-type Service struct {
-	Name         string
-	Namespace    string
-	SpecSelector map[string]string
-	Type         v1.ServiceType
-	Status       v1.ServiceStatus
-}
-
-type DaemonSet struct {
-	Name           string
-	Namespace      string
-	Labels         map[string]string
-	SpecContainers []v1.Container
-}
-
-type Deployment struct {
-	Name                    string
-	Namespace               string
-	Labels                  map[string]string
-	Annotations             map[string]string
-	MatchLabels             map[string]string
-	SpecSelector            *metav1.LabelSelector
-	SpecReplicas            *int32
-	SpecStrategy            appsv1.DeploymentStrategy
-	StatusAvailableReplicas int32
-	PodSpec                 PodSpec
-}
-
-type StatefulSet struct {
-	Name         string
-	Namespace    string
-	Labels       map[string]string
-	Annotations  map[string]string
-	SpecSelector *metav1.LabelSelector
-	SpecReplicas *int32
-	PodSpec      PodSpec
-}
-
-type PersistentVolumeClaim struct {
-	Name        string
-	Namespace   string
-	Spec        v1.PersistentVolumeClaimSpec
-	Labels      map[string]string
-	Annotations map[string]string
-}
-
-type StorageClass struct {
-	Name        string
-	Labels      map[string]string
-	Annotations map[string]string
-	Parameters  map[string]string
-	Provisioner string
-	TypeMeta    metav1.TypeMeta
-	Size        int
-}
-
-type Job struct {
-	Name      string
-	Namespace string
-	Status    batchv1.JobStatus
-}
-
-type PersistentVolume struct {
-	Name        string
-	Namespace   string
-	Labels      map[string]string
-	Annotations map[string]string
-	Spec        v1.PersistentVolumeSpec
-	Status      v1.PersistentVolumeStatus
-}
-
-type ReplicationController struct {
-	Name      string
-	Namespace string
-	Spec      v1.ReplicationControllerSpec
-}
-
-type PodDisruptionBudget struct {
-	Name      string
-	Namespace string
-	Spec      policyv1.PodDisruptionBudgetSpec
-	Status    policyv1.PodDisruptionBudgetStatus
-}
-
-type ReplicaSet struct {
-	Name         string
-	Namespace    string
-	SpecSelector *metav1.LabelSelector
-	Spec         appsv1.ReplicaSetSpec
-}
-
-type Volume struct {
-}
-
-// GetControllerOf returns a pointer to a copy of the controllerRef if controllee has a controller
-func GetControllerOf(pod *Pod) *metav1.OwnerReference {
-	ref := GetControllerOfNoCopy(pod)
-	if ref == nil {
-		return nil
-	}
-	cp := *ref
-	cp.Controller = ptr.To(*ref.Controller)
-	if ref.BlockOwnerDeletion != nil {
-		cp.BlockOwnerDeletion = ptr.To(*ref.BlockOwnerDeletion)
-	}
-	return &cp
-}
-
-// GetControllerOfNoCopy returns a pointer to the controllerRef if controllee has a controller
-func GetControllerOfNoCopy(pod *Pod) *metav1.OwnerReference {
-	refs := pod.OwnerReferences
-	for i := range refs {
-		if refs[i].Controller != nil && *refs[i].Controller {
-			return &refs[i]
-		}
-	}
-	return nil
-}
-
-func TransformNamespace(input *v1.Namespace) *Namespace {
-	return &Namespace{
-		Name:        input.Name,
-		Annotations: input.Annotations,
-		Labels:      input.Labels,
-	}
-}
-
-func TransformPodContainer(input v1.Container) Container {
-	return Container{
-		Name:      input.Name,
-		Resources: input.Resources,
-	}
-}
-
-func TransformPodStatus(input v1.PodStatus) PodStatus {
-	return PodStatus{
-		Phase:             input.Phase,
-		ContainerStatuses: input.ContainerStatuses,
-	}
-}
-
-func TransformPodSpec(input v1.PodSpec) PodSpec {
-	containers := make([]Container, len(input.Containers))
-	for i, container := range input.Containers {
-		containers[i] = TransformPodContainer(container)
-	}
-	return PodSpec{
-		NodeName:      input.NodeName,
-		Containers:    containers,
-		Volumes:       input.Volumes,
-		RestartPolicy: input.RestartPolicy,
-	}
-
-}
-
-func TransformTimestamp(input *metav1.Time) *time.Time {
-	if input == nil {
-		return nil
-	}
-
-	t := input.Time
-	return &t
-}
-
-func TransformPod(input *v1.Pod) *Pod {
-	return &Pod{
-		UID:               input.UID,
-		Name:              input.Name,
-		Namespace:         input.Namespace,
-		Labels:            input.Labels,
-		Annotations:       input.Annotations,
-		OwnerReferences:   input.OwnerReferences,
-		Spec:              TransformPodSpec(input.Spec),
-		Status:            TransformPodStatus(input.Status),
-		DeletionTimestamp: TransformTimestamp(input.DeletionTimestamp),
-	}
-}
-
-func TransformNode(input *v1.Node) *Node {
-	return &Node{
-		Name:           input.Name,
-		Labels:         input.Labels,
-		Annotations:    input.Annotations,
-		Status:         input.Status,
-		SpecProviderID: input.Spec.ProviderID,
-	}
-}
-
-func TransformService(input *v1.Service) *Service {
-	return &Service{
-		Name:         input.Name,
-		Namespace:    input.Namespace,
-		SpecSelector: input.Spec.Selector,
-		Type:         input.Spec.Type,
-		Status:       input.Status,
-	}
-}
-
-func TransformDaemonSet(input *appsv1.DaemonSet) *DaemonSet {
-	return &DaemonSet{
-		Name:           input.Name,
-		Namespace:      input.Namespace,
-		Labels:         input.Labels,
-		SpecContainers: input.Spec.Template.Spec.Containers,
-	}
-}
-
-func TransformDeployment(input *appsv1.Deployment) *Deployment {
-	return &Deployment{
-		Name:                    input.Name,
-		Namespace:               input.Namespace,
-		Labels:                  input.Labels,
-		MatchLabels:             input.Spec.Selector.MatchLabels,
-		SpecReplicas:            input.Spec.Replicas,
-		SpecSelector:            input.Spec.Selector,
-		SpecStrategy:            input.Spec.Strategy,
-		StatusAvailableReplicas: input.Status.AvailableReplicas,
-		PodSpec:                 TransformPodSpec(input.Spec.Template.Spec),
-	}
-}
-
-func TransformStatefulSet(input *appsv1.StatefulSet) *StatefulSet {
-	return &StatefulSet{
-		Name:         input.Name,
-		Namespace:    input.Namespace,
-		SpecSelector: input.Spec.Selector,
-		SpecReplicas: input.Spec.Replicas,
-		PodSpec:      TransformPodSpec(input.Spec.Template.Spec),
-	}
-}
-
-func TransformPersistentVolume(input *v1.PersistentVolume) *PersistentVolume {
-	return &PersistentVolume{
-		Name:        input.Name,
-		Namespace:   input.Namespace,
-		Labels:      input.Labels,
-		Annotations: input.Annotations,
-		Spec:        input.Spec,
-		Status:      input.Status,
-	}
-}
-
-func TransformPersistentVolumeClaim(input *v1.PersistentVolumeClaim) *PersistentVolumeClaim {
-	return &PersistentVolumeClaim{
-		Name:        input.Name,
-		Namespace:   input.Namespace,
-		Spec:        input.Spec,
-		Labels:      input.Labels,
-		Annotations: input.Annotations,
-	}
-}
-
-func TransformStorageClass(input *stv1.StorageClass) *StorageClass {
-	return &StorageClass{
-		Name:        input.Name,
-		Annotations: input.Annotations,
-		Labels:      input.Labels,
-		Parameters:  input.Parameters,
-		Provisioner: input.Provisioner,
-		TypeMeta:    input.TypeMeta,
-		Size:        input.Size(),
-	}
-}
-
-func TransformJob(input *batchv1.Job) *Job {
-	return &Job{
-		Name:      input.Name,
-		Namespace: input.Namespace,
-		Status:    input.Status,
-	}
-}
-
-func TransformReplicationController(input *v1.ReplicationController) *ReplicationController {
-	return &ReplicationController{
-		Name:      input.Name,
-		Namespace: input.Namespace,
-		Spec:      input.Spec,
-	}
-}
-
-func TransformPodDisruptionBudget(input *policyv1.PodDisruptionBudget) *PodDisruptionBudget {
-	return &PodDisruptionBudget{
-		Name:      input.Name,
-		Namespace: input.Namespace,
-		Spec:      input.Spec,
-		Status:    input.Status,
-	}
-}
-
-func TransformReplicaSet(input *appsv1.ReplicaSet) *ReplicaSet {
-	return &ReplicaSet{
-		Name:         input.Name,
-		Namespace:    input.Namespace,
-		Spec:         input.Spec,
-		SpecSelector: input.Spec.Selector,
-	}
-}
-
-// ClusterCache defines an contract for an object which caches components within a cluster, ensuring
-// up to date resources using watchers
-type ClusterCache interface {
-	// Run starts the watcher processes
-	Run()
-
-	// Stops the watcher processes
-	Stop()
-
-	// GetAllNamespaces returns all the cached namespaces
-	GetAllNamespaces() []*Namespace
-
-	// GetAllNodes returns all the cached nodes
-	GetAllNodes() []*Node
-
-	// GetAllPods returns all the cached pods
-	GetAllPods() []*Pod
-
-	// GetAllServices returns all the cached services
-	GetAllServices() []*Service
-
-	// GetAllDaemonSets returns all the cached DaemonSets
-	GetAllDaemonSets() []*DaemonSet
-
-	// GetAllDeployments returns all the cached deployments
-	GetAllDeployments() []*Deployment
-
-	// GetAllStatfulSets returns all the cached StatefulSets
-	GetAllStatefulSets() []*StatefulSet
-
-	// GetAllReplicaSets returns all the cached ReplicaSets
-	GetAllReplicaSets() []*ReplicaSet
-
-	// GetAllPersistentVolumes returns all the cached persistent volumes
-	GetAllPersistentVolumes() []*PersistentVolume
-
-	// GetAllPersistentVolumeClaims returns all the cached persistent volume claims
-	GetAllPersistentVolumeClaims() []*PersistentVolumeClaim
-
-	// GetAllStorageClasses returns all the cached storage classes
-	GetAllStorageClasses() []*StorageClass
-
-	// GetAllJobs returns all the cached jobs
-	GetAllJobs() []*Job
-
-	// GetAllPodDisruptionBudgets returns all cached pod disruption budgets
-	GetAllPodDisruptionBudgets() []*PodDisruptionBudget
-
-	// GetAllReplicationControllers returns all cached replication controllers
-	GetAllReplicationControllers() []*ReplicationController
-}
-
 // KubernetesClusterCache is the implementation of ClusterCache
 type KubernetesClusterCache struct {
 	client kubernetes.Interface
@@ -438,14 +42,14 @@ func initializeCache(wc WatchController, wg *sync.WaitGroup, cancel chan struct{
 	wc.WarmUp(cancel)
 }
 
-func NewKubernetesClusterCache(client kubernetes.Interface) ClusterCache {
+func NewKubernetesClusterCache(client kubernetes.Interface) cc.ClusterCache {
 	if env.GetUseCacheV1() {
 		return NewKubernetesClusterCacheV1(client)
 	}
 	return NewKubernetesClusterCacheV2(client)
 }
 
-func NewKubernetesClusterCacheV1(client kubernetes.Interface) ClusterCache {
+func NewKubernetesClusterCacheV1(client kubernetes.Interface) cc.ClusterCache {
 	coreRestClient := client.CoreV1().RESTClient()
 	appsRestClient := client.AppsV1().RESTClient()
 	storageRestClient := client.StorageV1().RESTClient()
@@ -534,128 +138,128 @@ func (kcc *KubernetesClusterCache) Stop() {
 	kcc.stop = nil
 }
 
-func (kcc *KubernetesClusterCache) GetAllNamespaces() []*Namespace {
-	var namespaces []*Namespace
+func (kcc *KubernetesClusterCache) GetAllNamespaces() []*cc.Namespace {
+	var namespaces []*cc.Namespace
 	items := kcc.namespaceWatch.GetAll()
 	for _, ns := range items {
-		namespaces = append(namespaces, TransformNamespace(ns.(*v1.Namespace)))
+		namespaces = append(namespaces, cc.TransformNamespace(ns.(*v1.Namespace)))
 	}
 	return namespaces
 }
 
-func (kcc *KubernetesClusterCache) GetAllNodes() []*Node {
-	var nodes []*Node
+func (kcc *KubernetesClusterCache) GetAllNodes() []*cc.Node {
+	var nodes []*cc.Node
 	items := kcc.nodeWatch.GetAll()
 	for _, node := range items {
-		nodes = append(nodes, TransformNode(node.(*v1.Node)))
+		nodes = append(nodes, cc.TransformNode(node.(*v1.Node)))
 	}
 	return nodes
 }
 
-func (kcc *KubernetesClusterCache) GetAllPods() []*Pod {
-	var pods []*Pod
+func (kcc *KubernetesClusterCache) GetAllPods() []*cc.Pod {
+	var pods []*cc.Pod
 	items := kcc.podWatch.GetAll()
 	for _, pod := range items {
-		pods = append(pods, TransformPod(pod.(*v1.Pod)))
+		pods = append(pods, cc.TransformPod(pod.(*v1.Pod)))
 	}
 	return pods
 }
 
-func (kcc *KubernetesClusterCache) GetAllServices() []*Service {
-	var services []*Service
+func (kcc *KubernetesClusterCache) GetAllServices() []*cc.Service {
+	var services []*cc.Service
 	items := kcc.serviceWatch.GetAll()
 	for _, service := range items {
-		services = append(services, TransformService(service.(*v1.Service)))
+		services = append(services, cc.TransformService(service.(*v1.Service)))
 	}
 	return services
 }
 
-func (kcc *KubernetesClusterCache) GetAllDaemonSets() []*DaemonSet {
-	var daemonsets []*DaemonSet
+func (kcc *KubernetesClusterCache) GetAllDaemonSets() []*cc.DaemonSet {
+	var daemonsets []*cc.DaemonSet
 	items := kcc.daemonsetsWatch.GetAll()
 	for _, daemonset := range items {
-		daemonsets = append(daemonsets, TransformDaemonSet(daemonset.(*appsv1.DaemonSet)))
+		daemonsets = append(daemonsets, cc.TransformDaemonSet(daemonset.(*appsv1.DaemonSet)))
 	}
 	return daemonsets
 }
 
-func (kcc *KubernetesClusterCache) GetAllDeployments() []*Deployment {
-	var deployments []*Deployment
+func (kcc *KubernetesClusterCache) GetAllDeployments() []*cc.Deployment {
+	var deployments []*cc.Deployment
 	items := kcc.deploymentsWatch.GetAll()
 	for _, deployment := range items {
-		deployments = append(deployments, TransformDeployment(deployment.(*appsv1.Deployment)))
+		deployments = append(deployments, cc.TransformDeployment(deployment.(*appsv1.Deployment)))
 	}
 	return deployments
 }
 
-func (kcc *KubernetesClusterCache) GetAllStatefulSets() []*StatefulSet {
-	var statefulsets []*StatefulSet
+func (kcc *KubernetesClusterCache) GetAllStatefulSets() []*cc.StatefulSet {
+	var statefulsets []*cc.StatefulSet
 	items := kcc.statefulsetWatch.GetAll()
 	for _, statefulset := range items {
-		statefulsets = append(statefulsets, TransformStatefulSet(statefulset.(*appsv1.StatefulSet)))
+		statefulsets = append(statefulsets, cc.TransformStatefulSet(statefulset.(*appsv1.StatefulSet)))
 	}
 	return statefulsets
 }
 
-func (kcc *KubernetesClusterCache) GetAllReplicaSets() []*ReplicaSet {
-	var replicasets []*ReplicaSet
+func (kcc *KubernetesClusterCache) GetAllReplicaSets() []*cc.ReplicaSet {
+	var replicasets []*cc.ReplicaSet
 	items := kcc.replicasetWatch.GetAll()
 	for _, replicaset := range items {
-		replicasets = append(replicasets, TransformReplicaSet(replicaset.(*appsv1.ReplicaSet)))
+		replicasets = append(replicasets, cc.TransformReplicaSet(replicaset.(*appsv1.ReplicaSet)))
 	}
 	return replicasets
 }
 
-func (kcc *KubernetesClusterCache) GetAllPersistentVolumes() []*PersistentVolume {
-	var pvs []*PersistentVolume
+func (kcc *KubernetesClusterCache) GetAllPersistentVolumes() []*cc.PersistentVolume {
+	var pvs []*cc.PersistentVolume
 	items := kcc.pvWatch.GetAll()
 	for _, pv := range items {
-		pvs = append(pvs, TransformPersistentVolume(pv.(*v1.PersistentVolume)))
+		pvs = append(pvs, cc.TransformPersistentVolume(pv.(*v1.PersistentVolume)))
 	}
 	return pvs
 }
 
-func (kcc *KubernetesClusterCache) GetAllPersistentVolumeClaims() []*PersistentVolumeClaim {
-	var pvcs []*PersistentVolumeClaim
+func (kcc *KubernetesClusterCache) GetAllPersistentVolumeClaims() []*cc.PersistentVolumeClaim {
+	var pvcs []*cc.PersistentVolumeClaim
 	items := kcc.pvcWatch.GetAll()
 	for _, pvc := range items {
-		pvcs = append(pvcs, TransformPersistentVolumeClaim(pvc.(*v1.PersistentVolumeClaim)))
+		pvcs = append(pvcs, cc.TransformPersistentVolumeClaim(pvc.(*v1.PersistentVolumeClaim)))
 	}
 	return pvcs
 }
 
-func (kcc *KubernetesClusterCache) GetAllStorageClasses() []*StorageClass {
-	var storageClasses []*StorageClass
+func (kcc *KubernetesClusterCache) GetAllStorageClasses() []*cc.StorageClass {
+	var storageClasses []*cc.StorageClass
 	items := kcc.storageClassWatch.GetAll()
 	for _, stc := range items {
-		storageClasses = append(storageClasses, TransformStorageClass(stc.(*stv1.StorageClass)))
+		storageClasses = append(storageClasses, cc.TransformStorageClass(stc.(*stv1.StorageClass)))
 	}
 	return storageClasses
 }
 
-func (kcc *KubernetesClusterCache) GetAllJobs() []*Job {
-	var jobs []*Job
+func (kcc *KubernetesClusterCache) GetAllJobs() []*cc.Job {
+	var jobs []*cc.Job
 	items := kcc.jobsWatch.GetAll()
 	for _, job := range items {
-		jobs = append(jobs, TransformJob(job.(*batchv1.Job)))
+		jobs = append(jobs, cc.TransformJob(job.(*batchv1.Job)))
 	}
 	return jobs
 }
 
-func (kcc *KubernetesClusterCache) GetAllPodDisruptionBudgets() []*PodDisruptionBudget {
-	var pdbs []*PodDisruptionBudget
+func (kcc *KubernetesClusterCache) GetAllPodDisruptionBudgets() []*cc.PodDisruptionBudget {
+	var pdbs []*cc.PodDisruptionBudget
 	items := kcc.pdbWatch.GetAll()
 	for _, pdb := range items {
-		pdbs = append(pdbs, TransformPodDisruptionBudget(pdb.(*policyv1.PodDisruptionBudget)))
+		pdbs = append(pdbs, cc.TransformPodDisruptionBudget(pdb.(*policyv1.PodDisruptionBudget)))
 	}
 	return pdbs
 }
 
-func (kcc *KubernetesClusterCache) GetAllReplicationControllers() []*ReplicationController {
-	var rcs []*ReplicationController
+func (kcc *KubernetesClusterCache) GetAllReplicationControllers() []*cc.ReplicationController {
+	var rcs []*cc.ReplicationController
 	items := kcc.replicationControllerWatch.GetAll()
 	for _, rc := range items {
-		rcs = append(rcs, TransformReplicationController(rc.(*v1.ReplicationController)))
+		rcs = append(rcs, cc.TransformReplicationController(rc.(*v1.ReplicationController)))
 	}
 	return rcs
 }

+ 43 - 42
pkg/clustercache/clustercache2.go

@@ -3,6 +3,7 @@ package clustercache
 import (
 	"sync"
 
+	cc "github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/env"
 	appsv1 "k8s.io/api/apps/v1"
 	batchv1 "k8s.io/api/batch/v1"
@@ -13,39 +14,39 @@ import (
 )
 
 type KubernetesClusterCacheV2 struct {
-	namespaceStore             *GenericStore[*v1.Namespace, *Namespace]
-	nodeStore                  *GenericStore[*v1.Node, *Node]
-	podStore                   *GenericStore[*v1.Pod, *Pod]
-	serviceStore               *GenericStore[*v1.Service, *Service]
-	daemonSetStore             *GenericStore[*appsv1.DaemonSet, *DaemonSet]
-	deploymentStore            *GenericStore[*appsv1.Deployment, *Deployment]
-	statefulSetStore           *GenericStore[*appsv1.StatefulSet, *StatefulSet]
-	persistentVolumeStore      *GenericStore[*v1.PersistentVolume, *PersistentVolume]
-	persistentVolumeClaimStore *GenericStore[*v1.PersistentVolumeClaim, *PersistentVolumeClaim]
-	storageClassStore          *GenericStore[*stv1.StorageClass, *StorageClass]
-	jobStore                   *GenericStore[*batchv1.Job, *Job]
-	replicationControllerStore *GenericStore[*v1.ReplicationController, *ReplicationController]
-	replicaSetStore            *GenericStore[*appsv1.ReplicaSet, *ReplicaSet]
-	pdbStore                   *GenericStore[*policyv1.PodDisruptionBudget, *PodDisruptionBudget]
+	namespaceStore             *GenericStore[*v1.Namespace, *cc.Namespace]
+	nodeStore                  *GenericStore[*v1.Node, *cc.Node]
+	podStore                   *GenericStore[*v1.Pod, *cc.Pod]
+	serviceStore               *GenericStore[*v1.Service, *cc.Service]
+	daemonSetStore             *GenericStore[*appsv1.DaemonSet, *cc.DaemonSet]
+	deploymentStore            *GenericStore[*appsv1.Deployment, *cc.Deployment]
+	statefulSetStore           *GenericStore[*appsv1.StatefulSet, *cc.StatefulSet]
+	persistentVolumeStore      *GenericStore[*v1.PersistentVolume, *cc.PersistentVolume]
+	persistentVolumeClaimStore *GenericStore[*v1.PersistentVolumeClaim, *cc.PersistentVolumeClaim]
+	storageClassStore          *GenericStore[*stv1.StorageClass, *cc.StorageClass]
+	jobStore                   *GenericStore[*batchv1.Job, *cc.Job]
+	replicationControllerStore *GenericStore[*v1.ReplicationController, *cc.ReplicationController]
+	replicaSetStore            *GenericStore[*appsv1.ReplicaSet, *cc.ReplicaSet]
+	pdbStore                   *GenericStore[*policyv1.PodDisruptionBudget, *cc.PodDisruptionBudget]
 	stopCh                     chan struct{}
 }
 
 func NewKubernetesClusterCacheV2(clientset kubernetes.Interface) *KubernetesClusterCacheV2 {
 	return &KubernetesClusterCacheV2{
-		namespaceStore:             CreateStore(clientset.CoreV1().RESTClient(), "namespaces", TransformNamespace),
-		nodeStore:                  CreateStore(clientset.CoreV1().RESTClient(), "nodes", TransformNode),
-		persistentVolumeClaimStore: CreateStore(clientset.CoreV1().RESTClient(), "persistentvolumeclaims", TransformPersistentVolumeClaim),
-		persistentVolumeStore:      CreateStore(clientset.CoreV1().RESTClient(), "persistentvolumes", TransformPersistentVolume),
-		podStore:                   CreateStore(clientset.CoreV1().RESTClient(), "pods", TransformPod),
-		replicationControllerStore: CreateStore(clientset.CoreV1().RESTClient(), "replicationcontrollers", TransformReplicationController),
-		serviceStore:               CreateStore(clientset.CoreV1().RESTClient(), "services", TransformService),
-		daemonSetStore:             CreateStore(clientset.AppsV1().RESTClient(), "daemonsets", TransformDaemonSet),
-		deploymentStore:            CreateStore(clientset.AppsV1().RESTClient(), "deployments", TransformDeployment),
-		replicaSetStore:            CreateStore(clientset.AppsV1().RESTClient(), "replicasets", TransformReplicaSet),
-		statefulSetStore:           CreateStore(clientset.AppsV1().RESTClient(), "statefulsets", TransformStatefulSet),
-		storageClassStore:          CreateStore(clientset.StorageV1().RESTClient(), "storageclasses", TransformStorageClass),
-		jobStore:                   CreateStore(clientset.BatchV1().RESTClient(), "jobs", TransformJob),
-		pdbStore:                   CreateStore(clientset.PolicyV1().RESTClient(), "poddisruptionbudgets", TransformPodDisruptionBudget),
+		namespaceStore:             CreateStore(clientset.CoreV1().RESTClient(), "namespaces", cc.TransformNamespace),
+		nodeStore:                  CreateStore(clientset.CoreV1().RESTClient(), "nodes", cc.TransformNode),
+		persistentVolumeClaimStore: CreateStore(clientset.CoreV1().RESTClient(), "persistentvolumeclaims", cc.TransformPersistentVolumeClaim),
+		persistentVolumeStore:      CreateStore(clientset.CoreV1().RESTClient(), "persistentvolumes", cc.TransformPersistentVolume),
+		podStore:                   CreateStore(clientset.CoreV1().RESTClient(), "pods", cc.TransformPod),
+		replicationControllerStore: CreateStore(clientset.CoreV1().RESTClient(), "replicationcontrollers", cc.TransformReplicationController),
+		serviceStore:               CreateStore(clientset.CoreV1().RESTClient(), "services", cc.TransformService),
+		daemonSetStore:             CreateStore(clientset.AppsV1().RESTClient(), "daemonsets", cc.TransformDaemonSet),
+		deploymentStore:            CreateStore(clientset.AppsV1().RESTClient(), "deployments", cc.TransformDeployment),
+		replicaSetStore:            CreateStore(clientset.AppsV1().RESTClient(), "replicasets", cc.TransformReplicaSet),
+		statefulSetStore:           CreateStore(clientset.AppsV1().RESTClient(), "statefulsets", cc.TransformStatefulSet),
+		storageClassStore:          CreateStore(clientset.StorageV1().RESTClient(), "storageclasses", cc.TransformStorageClass),
+		jobStore:                   CreateStore(clientset.BatchV1().RESTClient(), "jobs", cc.TransformJob),
+		pdbStore:                   CreateStore(clientset.PolicyV1().RESTClient(), "poddisruptionbudgets", cc.TransformPodDisruptionBudget),
 		stopCh:                     make(chan struct{}),
 	}
 }
@@ -83,58 +84,58 @@ func (kcc *KubernetesClusterCacheV2) Stop() {
 	}
 }
 
-func (kcc *KubernetesClusterCacheV2) GetAllNamespaces() []*Namespace {
+func (kcc *KubernetesClusterCacheV2) GetAllNamespaces() []*cc.Namespace {
 	return kcc.namespaceStore.GetAll()
 }
 
-func (kcc *KubernetesClusterCacheV2) GetAllNodes() []*Node {
+func (kcc *KubernetesClusterCacheV2) GetAllNodes() []*cc.Node {
 	return kcc.nodeStore.GetAll()
 }
 
-func (kcc *KubernetesClusterCacheV2) GetAllPods() []*Pod {
+func (kcc *KubernetesClusterCacheV2) GetAllPods() []*cc.Pod {
 	return kcc.podStore.GetAll()
 }
 
-func (kcc *KubernetesClusterCacheV2) GetAllServices() []*Service {
+func (kcc *KubernetesClusterCacheV2) GetAllServices() []*cc.Service {
 	return kcc.serviceStore.GetAll()
 }
 
-func (kcc *KubernetesClusterCacheV2) GetAllDaemonSets() []*DaemonSet {
+func (kcc *KubernetesClusterCacheV2) GetAllDaemonSets() []*cc.DaemonSet {
 	return kcc.daemonSetStore.GetAll()
 }
 
-func (kcc *KubernetesClusterCacheV2) GetAllDeployments() []*Deployment {
+func (kcc *KubernetesClusterCacheV2) GetAllDeployments() []*cc.Deployment {
 	return kcc.deploymentStore.GetAll()
 }
 
-func (kcc *KubernetesClusterCacheV2) GetAllStatefulSets() []*StatefulSet {
+func (kcc *KubernetesClusterCacheV2) GetAllStatefulSets() []*cc.StatefulSet {
 	return kcc.statefulSetStore.GetAll()
 }
 
-func (kcc *KubernetesClusterCacheV2) GetAllPersistentVolumes() []*PersistentVolume {
+func (kcc *KubernetesClusterCacheV2) GetAllPersistentVolumes() []*cc.PersistentVolume {
 	return kcc.persistentVolumeStore.GetAll()
 }
 
-func (kcc *KubernetesClusterCacheV2) GetAllPersistentVolumeClaims() []*PersistentVolumeClaim {
+func (kcc *KubernetesClusterCacheV2) GetAllPersistentVolumeClaims() []*cc.PersistentVolumeClaim {
 	return kcc.persistentVolumeClaimStore.GetAll()
 }
 
-func (kcc *KubernetesClusterCacheV2) GetAllStorageClasses() []*StorageClass {
+func (kcc *KubernetesClusterCacheV2) GetAllStorageClasses() []*cc.StorageClass {
 	return kcc.storageClassStore.GetAll()
 }
 
-func (kcc *KubernetesClusterCacheV2) GetAllJobs() []*Job {
+func (kcc *KubernetesClusterCacheV2) GetAllJobs() []*cc.Job {
 	return kcc.jobStore.GetAll()
 }
 
-func (kcc *KubernetesClusterCacheV2) GetAllReplicationControllers() []*ReplicationController {
+func (kcc *KubernetesClusterCacheV2) GetAllReplicationControllers() []*cc.ReplicationController {
 	return kcc.replicationControllerStore.GetAll()
 }
 
-func (kcc *KubernetesClusterCacheV2) GetAllReplicaSets() []*ReplicaSet {
+func (kcc *KubernetesClusterCacheV2) GetAllReplicaSets() []*cc.ReplicaSet {
 	return kcc.replicaSetStore.GetAll()
 }
 
-func (kcc *KubernetesClusterCacheV2) GetAllPodDisruptionBudgets() []*PodDisruptionBudget {
+func (kcc *KubernetesClusterCacheV2) GetAllPodDisruptionBudgets() []*cc.PodDisruptionBudget {
 	return kcc.pdbStore.GetAll()
 }

+ 17 - 16
pkg/clustercache/clusterexporter.go

@@ -3,6 +3,7 @@ package clustercache
 import (
 	"time"
 
+	cc "github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/log"
 	"github.com/opencost/opencost/core/pkg/util/atomic"
 	"github.com/opencost/opencost/core/pkg/util/json"
@@ -11,32 +12,32 @@ import (
 
 // clusterEncoding is used to represent the cluster objects in the encoded states.
 type clusterEncoding struct {
-	Namespaces             []*Namespace             `json:"namespaces,omitempty"`
-	Nodes                  []*Node                  `json:"nodes,omitempty"`
-	Pods                   []*Pod                   `json:"pods,omitempty"`
-	Services               []*Service               `json:"services,omitempty"`
-	DaemonSets             []*DaemonSet             `json:"daemonSets,omitempty"`
-	Deployments            []*Deployment            `json:"deployments,omitempty"`
-	StatefulSets           []*StatefulSet           `json:"statefulSets,omitempty"`
-	ReplicaSets            []*ReplicaSet            `json:"replicaSets,omitempty"`
-	PersistentVolumes      []*PersistentVolume      `json:"persistentVolumes,omitempty"`
-	PersistentVolumeClaims []*PersistentVolumeClaim `json:"persistentVolumeClaims,omitempty"`
-	StorageClasses         []*StorageClass          `json:"storageClasses,omitempty"`
-	Jobs                   []*Job                   `json:"jobs,omitempty"`
-	PodDisruptionBudgets   []*PodDisruptionBudget   `json:"podDisruptionBudgets,omitempty"`
-	ReplicationControllers []*ReplicationController `json:"replicationController,omitempty"`
+	Namespaces             []*cc.Namespace             `json:"namespaces,omitempty"`
+	Nodes                  []*cc.Node                  `json:"nodes,omitempty"`
+	Pods                   []*cc.Pod                   `json:"pods,omitempty"`
+	Services               []*cc.Service               `json:"services,omitempty"`
+	DaemonSets             []*cc.DaemonSet             `json:"daemonSets,omitempty"`
+	Deployments            []*cc.Deployment            `json:"deployments,omitempty"`
+	StatefulSets           []*cc.StatefulSet           `json:"statefulSets,omitempty"`
+	ReplicaSets            []*cc.ReplicaSet            `json:"replicaSets,omitempty"`
+	PersistentVolumes      []*cc.PersistentVolume      `json:"persistentVolumes,omitempty"`
+	PersistentVolumeClaims []*cc.PersistentVolumeClaim `json:"persistentVolumeClaims,omitempty"`
+	StorageClasses         []*cc.StorageClass          `json:"storageClasses,omitempty"`
+	Jobs                   []*cc.Job                   `json:"jobs,omitempty"`
+	PodDisruptionBudgets   []*cc.PodDisruptionBudget   `json:"podDisruptionBudgets,omitempty"`
+	ReplicationControllers []*cc.ReplicationController `json:"replicationController,omitempty"`
 }
 
 // ClusterExporter manages and runs an file export process which dumps the local kubernetes cluster to a target location.
 type ClusterExporter struct {
-	cluster  ClusterCache
+	cluster  cc.ClusterCache
 	target   *config.ConfigFile
 	interval time.Duration
 	runState atomic.AtomicRunState
 }
 
 // NewClusterExporter creates a new ClusterExporter instance for exporting the kubernetes cluster.
-func NewClusterExporter(cluster ClusterCache, target *config.ConfigFile, interval time.Duration) *ClusterExporter {
+func NewClusterExporter(cluster cc.ClusterCache, target *config.ConfigFile, interval time.Duration) *ClusterExporter {
 	return &ClusterExporter{
 		cluster:  cluster,
 		target:   target,

+ 16 - 15
pkg/clustercache/clusterimporter.go

@@ -3,6 +3,7 @@ package clustercache
 import (
 	"sync"
 
+	cc "github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/log"
 	"github.com/opencost/opencost/core/pkg/util/json"
 	"github.com/opencost/opencost/pkg/config"
@@ -19,7 +20,7 @@ type ClusterImporter struct {
 }
 
 // Creates a new ClusterCache implementation which uses an import process to provide cluster data
-func NewClusterImporter(source *config.ConfigFile) ClusterCache {
+func NewClusterImporter(source *config.ConfigFile) cc.ClusterCache {
 	return &ClusterImporter{
 		source:   source,
 		dataLock: new(sync.Mutex),
@@ -87,7 +88,7 @@ func (ci *ClusterImporter) Stop() {
 }
 
 // GetAllNamespaces returns all the cached namespaces
-func (ci *ClusterImporter) GetAllNamespaces() []*Namespace {
+func (ci *ClusterImporter) GetAllNamespaces() []*cc.Namespace {
 	ci.dataLock.Lock()
 	defer ci.dataLock.Unlock()
 
@@ -95,7 +96,7 @@ func (ci *ClusterImporter) GetAllNamespaces() []*Namespace {
 }
 
 // GetAllNodes returns all the cached nodes
-func (ci *ClusterImporter) GetAllNodes() []*Node {
+func (ci *ClusterImporter) GetAllNodes() []*cc.Node {
 	ci.dataLock.Lock()
 	defer ci.dataLock.Unlock()
 
@@ -103,7 +104,7 @@ func (ci *ClusterImporter) GetAllNodes() []*Node {
 }
 
 // GetAllPods returns all the cached pods
-func (ci *ClusterImporter) GetAllPods() []*Pod {
+func (ci *ClusterImporter) GetAllPods() []*cc.Pod {
 	ci.dataLock.Lock()
 	defer ci.dataLock.Unlock()
 
@@ -111,7 +112,7 @@ func (ci *ClusterImporter) GetAllPods() []*Pod {
 }
 
 // GetAllServices returns all the cached services
-func (ci *ClusterImporter) GetAllServices() []*Service {
+func (ci *ClusterImporter) GetAllServices() []*cc.Service {
 	ci.dataLock.Lock()
 	defer ci.dataLock.Unlock()
 
@@ -119,7 +120,7 @@ func (ci *ClusterImporter) GetAllServices() []*Service {
 }
 
 // GetAllDaemonSets returns all the cached DaemonSets
-func (ci *ClusterImporter) GetAllDaemonSets() []*DaemonSet {
+func (ci *ClusterImporter) GetAllDaemonSets() []*cc.DaemonSet {
 	ci.dataLock.Lock()
 	defer ci.dataLock.Unlock()
 
@@ -127,7 +128,7 @@ func (ci *ClusterImporter) GetAllDaemonSets() []*DaemonSet {
 }
 
 // GetAllDeployments returns all the cached deployments
-func (ci *ClusterImporter) GetAllDeployments() []*Deployment {
+func (ci *ClusterImporter) GetAllDeployments() []*cc.Deployment {
 	ci.dataLock.Lock()
 	defer ci.dataLock.Unlock()
 
@@ -135,7 +136,7 @@ func (ci *ClusterImporter) GetAllDeployments() []*Deployment {
 }
 
 // GetAllStatfulSets returns all the cached StatefulSets
-func (ci *ClusterImporter) GetAllStatefulSets() []*StatefulSet {
+func (ci *ClusterImporter) GetAllStatefulSets() []*cc.StatefulSet {
 	ci.dataLock.Lock()
 	defer ci.dataLock.Unlock()
 
@@ -143,7 +144,7 @@ func (ci *ClusterImporter) GetAllStatefulSets() []*StatefulSet {
 }
 
 // GetAllReplicaSets returns all the cached ReplicaSets
-func (ci *ClusterImporter) GetAllReplicaSets() []*ReplicaSet {
+func (ci *ClusterImporter) GetAllReplicaSets() []*cc.ReplicaSet {
 	ci.dataLock.Lock()
 	defer ci.dataLock.Unlock()
 
@@ -151,7 +152,7 @@ func (ci *ClusterImporter) GetAllReplicaSets() []*ReplicaSet {
 }
 
 // GetAllPersistentVolumes returns all the cached persistent volumes
-func (ci *ClusterImporter) GetAllPersistentVolumes() []*PersistentVolume {
+func (ci *ClusterImporter) GetAllPersistentVolumes() []*cc.PersistentVolume {
 	ci.dataLock.Lock()
 	defer ci.dataLock.Unlock()
 
@@ -159,7 +160,7 @@ func (ci *ClusterImporter) GetAllPersistentVolumes() []*PersistentVolume {
 }
 
 // GetAllPersistentVolumeClaims returns all the cached persistent volume claims
-func (ci *ClusterImporter) GetAllPersistentVolumeClaims() []*PersistentVolumeClaim {
+func (ci *ClusterImporter) GetAllPersistentVolumeClaims() []*cc.PersistentVolumeClaim {
 	ci.dataLock.Lock()
 	defer ci.dataLock.Unlock()
 
@@ -167,7 +168,7 @@ func (ci *ClusterImporter) GetAllPersistentVolumeClaims() []*PersistentVolumeCla
 }
 
 // GetAllStorageClasses returns all the cached storage classes
-func (ci *ClusterImporter) GetAllStorageClasses() []*StorageClass {
+func (ci *ClusterImporter) GetAllStorageClasses() []*cc.StorageClass {
 	ci.dataLock.Lock()
 	defer ci.dataLock.Unlock()
 
@@ -175,7 +176,7 @@ func (ci *ClusterImporter) GetAllStorageClasses() []*StorageClass {
 }
 
 // GetAllJobs returns all the cached jobs
-func (ci *ClusterImporter) GetAllJobs() []*Job {
+func (ci *ClusterImporter) GetAllJobs() []*cc.Job {
 	ci.dataLock.Lock()
 	defer ci.dataLock.Unlock()
 
@@ -183,14 +184,14 @@ func (ci *ClusterImporter) GetAllJobs() []*Job {
 }
 
 // GetAllPodDisruptionBudgets returns all cached pod disruption budgets
-func (ci *ClusterImporter) GetAllPodDisruptionBudgets() []*PodDisruptionBudget {
+func (ci *ClusterImporter) GetAllPodDisruptionBudgets() []*cc.PodDisruptionBudget {
 	ci.dataLock.Lock()
 	defer ci.dataLock.Unlock()
 
 	return slices.Clone(ci.data.PodDisruptionBudgets)
 }
 
-func (ci *ClusterImporter) GetAllReplicationControllers() []*ReplicationController {
+func (ci *ClusterImporter) GetAllReplicationControllers() []*cc.ReplicationController {
 	ci.dataLock.Lock()
 	defer ci.dataLock.Unlock()
 

+ 5 - 4
pkg/cmd/agent/agent.go

@@ -13,10 +13,11 @@ import (
 	"github.com/opencost/opencost/core/pkg/util/retry"
 	"github.com/opencost/opencost/pkg/util/watcher"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/version"
 	"github.com/opencost/opencost/modules/prometheus-source/pkg/prom"
 	"github.com/opencost/opencost/pkg/cloud/provider"
-	"github.com/opencost/opencost/pkg/clustercache"
+	cluster "github.com/opencost/opencost/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/config"
 	"github.com/opencost/opencost/pkg/costmodel"
 	"github.com/opencost/opencost/pkg/env"
@@ -39,7 +40,7 @@ const ClusterExportInterval = 5 * time.Minute
 
 // clusterExporter is used if env.IsExportClusterCacheEnabled() is set to true
 // it will export the kubernetes cluster data to a file on a specific interval
-var clusterExporter *clustercache.ClusterExporter
+var clusterExporter *cluster.ClusterExporter
 
 func Healthz(w http.ResponseWriter, _ *http.Request) {
 	w.WriteHeader(200)
@@ -58,7 +59,7 @@ func newKubernetesClusterCache() (kubernetes.Interface, clustercache.ClusterCach
 	}
 
 	// Create Kubernetes Cluster Cache + Watchers
-	k8sCache := clustercache.NewKubernetesClusterCache(kubeClientset)
+	k8sCache := cluster.NewKubernetesClusterCache(kubeClientset)
 	k8sCache.Run()
 
 	return kubeClientset, k8sCache, nil
@@ -136,7 +137,7 @@ func Execute(opts *AgentOpts) error {
 	// Initialize cluster exporting if it's enabled
 	if env.IsExportClusterCacheEnabled() {
 		cacheLocation := confManager.ConfigFileAt(path.Join(configPrefix, "cluster-cache.json"))
-		clusterExporter = clustercache.NewClusterExporter(clusterCache, cacheLocation, ClusterExportInterval)
+		clusterExporter = cluster.NewClusterExporter(clusterCache, cacheLocation, ClusterExportInterval)
 		clusterExporter.Run()
 	}
 

+ 1 - 1
pkg/costmodel/containerkeys.go

@@ -6,9 +6,9 @@ import (
 	"regexp"
 	"strings"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/log"
 	"github.com/opencost/opencost/core/pkg/source"
-	"github.com/opencost/opencost/pkg/clustercache"
 )
 
 var (

+ 1 - 1
pkg/costmodel/costmodel.go

@@ -9,6 +9,7 @@ import (
 	"strings"
 	"time"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/clusters"
 	"github.com/opencost/opencost/core/pkg/log"
 	"github.com/opencost/opencost/core/pkg/opencost"
@@ -16,7 +17,6 @@ import (
 	"github.com/opencost/opencost/core/pkg/util"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
 	costAnalyzerCloud "github.com/opencost/opencost/pkg/cloud/models"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/env"
 	v1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

+ 1 - 1
pkg/costmodel/costmodel_test.go

@@ -5,8 +5,8 @@ import (
 	"testing"
 	"time"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/util"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/stretchr/testify/assert"
 	v1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/api/resource"

+ 1 - 1
pkg/costmodel/metrics.go

@@ -7,6 +7,7 @@ import (
 	"sync"
 	"time"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/clusters"
 	"github.com/opencost/opencost/core/pkg/errors"
 	"github.com/opencost/opencost/core/pkg/log"
@@ -15,7 +16,6 @@ import (
 	"github.com/opencost/opencost/core/pkg/util/atomic"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
 	"github.com/opencost/opencost/pkg/cloud/models"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/env"
 	"github.com/opencost/opencost/pkg/metrics"
 

+ 1 - 1
pkg/costmodel/resultparsers.go

@@ -5,11 +5,11 @@ import (
 	"fmt"
 	"time"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/log"
 	"github.com/opencost/opencost/core/pkg/source"
 	"github.com/opencost/opencost/core/pkg/util"
 	costAnalyzerCloud "github.com/opencost/opencost/pkg/cloud/models"
-	"github.com/opencost/opencost/pkg/clustercache"
 )
 
 func GetPVInfoLocal(cache clustercache.ClusterCache, defaultClusterID string) (map[string]*PersistentVolumeClaimData, error) {

+ 3 - 2
pkg/costmodel/router.go

@@ -31,6 +31,7 @@ import (
 
 	"github.com/julienschmidt/httprouter"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/clusters"
 	sysenv "github.com/opencost/opencost/core/pkg/env"
 	"github.com/opencost/opencost/core/pkg/log"
@@ -38,7 +39,7 @@ import (
 	"github.com/opencost/opencost/modules/prometheus-source/pkg/prom"
 	"github.com/opencost/opencost/pkg/cloud/azure"
 	"github.com/opencost/opencost/pkg/cloud/models"
-	"github.com/opencost/opencost/pkg/clustercache"
+	clusterc "github.com/opencost/opencost/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/env"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
@@ -499,7 +500,7 @@ func Initialize(router *httprouter.Router, additionalConfigWatchers ...*watcher.
 	}
 
 	// Create Kubernetes Cluster Cache + Watchers
-	k8sCache := clustercache.NewKubernetesClusterCache(kubeClientset)
+	k8sCache := clusterc.NewKubernetesClusterCache(kubeClientset)
 	k8sCache.Run()
 
 	// Create ConfigFileManager for synchronization of shared configuration

+ 1 - 1
pkg/metrics/deploymentmetrics.go

@@ -1,8 +1,8 @@
 package metrics
 
 import (
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
-	"github.com/opencost/opencost/pkg/clustercache"
 
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"

+ 1 - 1
pkg/metrics/jobmetrics.go

@@ -1,7 +1,7 @@
 package metrics
 
 import (
-	"github.com/opencost/opencost/pkg/clustercache"
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	batchv1 "k8s.io/api/batch/v1"

+ 1 - 1
pkg/metrics/kubemetrics.go

@@ -5,8 +5,8 @@ import (
 	"strings"
 	"sync"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
-	"github.com/opencost/opencost/pkg/clustercache"
 
 	"github.com/prometheus/client_golang/prometheus"
 	batchv1 "k8s.io/api/batch/v1"

+ 1 - 1
pkg/metrics/namespacemetrics.go

@@ -1,8 +1,8 @@
 package metrics
 
 import (
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
-	"github.com/opencost/opencost/pkg/clustercache"
 
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"

+ 1 - 1
pkg/metrics/nodemetrics.go

@@ -3,9 +3,9 @@ package metrics
 import (
 	"strings"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/log"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	v1 "k8s.io/api/core/v1"

+ 1 - 1
pkg/metrics/podlabelmetrics.go

@@ -1,8 +1,8 @@
 package metrics
 
 import (
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/prometheus/client_golang/prometheus"
 )
 

+ 1 - 1
pkg/metrics/podlabelmetrics_test.go

@@ -3,7 +3,7 @@ package metrics
 import (
 	"testing"
 
-	"github.com/opencost/opencost/pkg/clustercache"
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 

+ 1 - 1
pkg/metrics/podmetrics.go

@@ -3,9 +3,9 @@ package metrics
 import (
 	"fmt"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/log"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	v1 "k8s.io/api/core/v1"

+ 1 - 1
pkg/metrics/pvcmetrics.go

@@ -1,7 +1,7 @@
 package metrics
 
 import (
-	"github.com/opencost/opencost/pkg/clustercache"
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	v1 "k8s.io/api/core/v1"

+ 1 - 1
pkg/metrics/pvmetrics.go

@@ -1,7 +1,7 @@
 package metrics
 
 import (
-	"github.com/opencost/opencost/pkg/clustercache"
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	v1 "k8s.io/api/core/v1"

+ 1 - 1
pkg/metrics/servicemetrics.go

@@ -1,8 +1,8 @@
 package metrics
 
 import (
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
-	"github.com/opencost/opencost/pkg/clustercache"
 
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"

+ 1 - 1
pkg/metrics/statefulsetmetrics.go

@@ -1,8 +1,8 @@
 package metrics
 
 import (
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/core/pkg/util/promutil"
-	"github.com/opencost/opencost/pkg/clustercache"
 
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"

+ 1 - 1
test/cloud_test.go

@@ -11,8 +11,8 @@ import (
 
 	"github.com/opencost/opencost/core/pkg/clusters"
 
+	"github.com/opencost/opencost/core/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/cloud/provider"
-	"github.com/opencost/opencost/pkg/clustercache"
 	"github.com/opencost/opencost/pkg/config"
 	"github.com/opencost/opencost/pkg/costmodel"