K8s: Get trash fixes (#106411)
This commit is contained in:
committed by
GitHub
parent
8fdf86e56f
commit
7864c1660f
@@ -780,7 +780,14 @@ func (b *backend) getHistory(ctx context.Context, req *resourcepb.ListRequest, c
|
||||
listReq.MinRV = latestDeletedRV + 1
|
||||
}
|
||||
|
||||
rows, err := dbutil.QueryRows(ctx, tx, sqlResourceHistoryGet, listReq)
|
||||
var rows db.Rows
|
||||
if listReq.Trash {
|
||||
// unlike history, trash will not return an object if an object of the same name is live
|
||||
// (i.e. in the resource table)
|
||||
rows, err = dbutil.QueryRows(ctx, tx, sqlResourceTrash, listReq)
|
||||
} else {
|
||||
rows, err = dbutil.QueryRows(ctx, tx, sqlResourceHistoryGet, listReq)
|
||||
}
|
||||
if rows != nil {
|
||||
defer func() {
|
||||
if err := rows.Close(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user