LastImportTime for resource. (#112153)

* LastImportTime for resource.

* Make StorageBackendImpl implement GetResourceLastImportTimes

* More missing implementations of GetResourceLastImportTimes

* Fix import.

* Skip TestGetResourceLastImportTime in TestBadgerKVStorageBackend.

* Implement GetResourceLastImportTimes by mockStorageBackend

* Bump test tolerance.

* Fix postgres query and timezone.

* Fix postgres query and timezone.

* Make linter happy.
This commit is contained in:
Peter Štibraný
2025-10-09 11:27:11 +02:00
committed by GitHub
parent 3cdae5d67d
commit d801b87db9
24 changed files with 476 additions and 8 deletions
+8
View File
@@ -86,6 +86,11 @@ type BackendReadResponse struct {
Error *resourcepb.ErrorResult
}
type ResourceLastImportTime struct {
NamespacedResource
LastImportTime time.Time
}
// The StorageBackend is an internal abstraction that supports interacting with
// the underlying raw storage medium. This interface is never exposed directly,
// it is provided by concrete instances that actually write values.
@@ -118,6 +123,9 @@ type StorageBackend interface {
// Get resource stats within the storage backend. When namespace is empty, it will apply to all
GetResourceStats(ctx context.Context, namespace string, minCount int) ([]ResourceStats, error)
// GetResourceLastImportTimes returns import times for all namespaced resources in the backend.
GetResourceLastImportTimes(ctx context.Context) iter.Seq2[ResourceLastImportTime, error]
}
type ModifiedResource struct {