feat: add the default gc config #3987
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces changes to support a default garbage collection (GC) configuration in the database layer. The most important updates include adding new constants and types for GC configuration, seeding the database with a default GC configuration, and importing necessary dependencies.
Database enhancements:
manager/database/database.go
: Updated theseed
function to create a default GC configuration in the database if it does not already exist. This involves defining default TTL values for audit and job configurations, serializing them to JSON, and storing them in theConfig
table.Configuration model updates:
manager/models/config.go
: Added constants for the GC configuration name (ConfigGC
) and default TTL values (DefaultGCJobTTL
,DefaultGCAuditTTL
). These values are used to define the default behavior for GC operations.manager/models/config.go
: Introduced new typesGCConfig
,GCAuditConfig
, andGCJobConfig
to represent the structure of the GC configuration, including TTL fields for audit and job settings.Dependency updates:
manager/database/database.go
: Imported theencoding/json
package to handle JSON serialization of the GC configuration.Description
Related Issue
#3811
Motivation and Context
Screenshots (if appropriate)
Types of changes
Checklist