Secrets: garbage collection (#110247)
* clean up older secret versions * start gargbage collection worker as background service * make gen-go * fix typo * make update-workspace * undo go mod changes * undo go work sum changes * Update pkg/registry/apis/secret/garbagecollectionworker/worker.go Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com> * Update pkg/registry/apis/secret/garbagecollectionworker/worker.go Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com> * default gc_worker_batch_size to 1 minute * fix typo * fix typo * add test to ensure cleaning up secure values is idempotent * make gen-go * make update-workspace * undo go.mod and .sum changes * undo enterprise imports --------- Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com> Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
This commit is contained in:
co-authored by
Matheus Macabu
Matheus Macabu
parent
d5eb3e291a
commit
f8cd7049e8
@@ -3,6 +3,7 @@ package metadata
|
||||
import (
|
||||
"testing"
|
||||
"text/template"
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/storage/unified/sql/sqltemplate/mocks"
|
||||
"k8s.io/utils/ptr"
|
||||
@@ -238,6 +239,39 @@ func TestSecureValueQueries(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
sqlSecureValueDelete: {
|
||||
{
|
||||
Name: "deleteSecureValue",
|
||||
Data: &deleteSecureValue{
|
||||
SQLTemplate: mocks.NewTestingSQLTemplate(),
|
||||
Namespace: "ns",
|
||||
Name: "name",
|
||||
Version: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
sqlSecureValueLeaseInactive: {
|
||||
{
|
||||
Name: "lease inactive",
|
||||
Data: &leaseInactiveSecureValues{
|
||||
SQLTemplate: mocks.NewTestingSQLTemplate(),
|
||||
Now: 10,
|
||||
LeaseToken: "token",
|
||||
LeaseTTL: int64((30 * time.Second).Seconds()),
|
||||
MaxBatchSize: 10,
|
||||
MinAge: int64((300 * time.Second).Seconds()),
|
||||
},
|
||||
},
|
||||
},
|
||||
sqlSecureValueListByLeaseToken: {
|
||||
{
|
||||
Name: "list by lease token",
|
||||
Data: &listSecureValuesByLeaseToken{
|
||||
SQLTemplate: mocks.NewTestingSQLTemplate(),
|
||||
LeaseToken: "token",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user