fix(unified-storage): unlist the deleted resource's versions (#102588)

This commit is contained in:
Mustafa Sencer Özcan
2025-03-27 18:34:37 +01:00
committed by GitHub
parent d10fdc0f02
commit fe1a72e41b
12 changed files with 478 additions and 50 deletions

View File

@ -147,9 +147,9 @@ func TestUnifiedStorageQueries(t *testing.T) {
sqlResourceHistoryRead: {
{
Name: "single path",
Data: &sqlResourceReadRequest{
Data: &sqlResourceHistoryReadRequest{
SQLTemplate: mocks.NewTestingSQLTemplate(),
Request: &resource.ReadRequest{
Request: &historyReadRequest{
ResourceVersion: 123,
Key: &resource.ResourceKey{
Namespace: "ns",
@ -163,6 +163,40 @@ func TestUnifiedStorageQueries(t *testing.T) {
},
},
sqlResourceHistoryReadLatestRV: {
{
Name: "single path",
Data: &sqlResourceHistoryReadLatestRVRequest{
SQLTemplate: mocks.NewTestingSQLTemplate(),
Request: &historyReadLatestRVRequest{
Key: &resource.ResourceKey{
Namespace: "ns",
Group: "gp",
Resource: "rs",
Name: "nm",
},
},
Response: new(resourceHistoryReadLatestRVResponse),
},
},
{
Name: "with WatchEvent_DELETED",
Data: &sqlResourceHistoryReadLatestRVRequest{
SQLTemplate: mocks.NewTestingSQLTemplate(),
Request: &historyReadLatestRVRequest{
Key: &resource.ResourceKey{
Namespace: "ns",
Group: "gp",
Resource: "rs",
Name: "nm",
},
EventType: resource.WatchEvent_DELETED,
},
Response: new(resourceHistoryReadLatestRVResponse),
},
},
},
sqlResourceHistoryUpdateRV: {
{
Name: "single path",