Add retention flag specific for s3

* Add retention flag specific for s3
* Add retention for the unit tests:

Signed-off-by: Vitor Savian <vitor.savian@suse.com>
This commit is contained in:
Vitor Savian
2025-07-28 13:42:09 -03:00
parent 17cfde1c82
commit 968460dfe8
10 changed files with 107 additions and 42 deletions

View File

@@ -124,6 +124,13 @@ var EtcdSnapshotFlags = []cli.Flag{
Destination: &ServerConfig.EtcdS3Region,
Value: "us-east-1",
},
&cli.IntFlag{
Name: "s3-retention",
Aliases: []string{"etcd-s3-retention"},
Usage: "(db) Number of s3 snapshots to retain.",
Destination: &ServerConfig.EtcdS3Retention,
Value: defaultSnapshotRentention,
},
&cli.StringFlag{
Name: "s3-folder",
Aliases: []string{"etcd-s3-folder"},

View File

@@ -105,6 +105,7 @@ type Server struct {
EtcdS3SecretKey string
EtcdS3SessionToken string
EtcdS3BucketName string
EtcdS3Retention int
EtcdS3BucketLookupType string
EtcdS3Region string
EtcdS3Folder string
@@ -480,6 +481,12 @@ var ServerFlags = []cli.Flag{
Usage: "(db) S3 folder",
Destination: &ServerConfig.EtcdS3Folder,
},
&cli.IntFlag{
Name: "etcd-s3-retention",
Usage: "(db) S3 retention limit",
Destination: &ServerConfig.EtcdS3Retention,
Value: defaultSnapshotRentention,
},
&cli.StringFlag{
Name: "etcd-s3-proxy",
Usage: "(db) Proxy server to use when connecting to S3, overriding any proxy-releated environment variables",