mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-08-03 20:59:52 +00:00
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:
@@ -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"},
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -65,6 +65,7 @@ func commandSetup(app *cli.Context, cfg *cmds.Server) (*etcd.SnapshotRequest, *c
|
||||
Region: cfg.EtcdS3Region,
|
||||
SecretKey: cfg.EtcdS3SecretKey,
|
||||
SkipSSLVerify: cfg.EtcdS3SkipSSLVerify,
|
||||
Retention: cfg.EtcdS3Retention,
|
||||
Timeout: metav1.Duration{Duration: cfg.EtcdS3Timeout},
|
||||
}
|
||||
// extend request timeout to allow the S3 operation to complete
|
||||
|
||||
@@ -210,6 +210,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
|
||||
SecretKey: cfg.EtcdS3SecretKey,
|
||||
SessionToken: cfg.EtcdS3SessionToken,
|
||||
SkipSSLVerify: cfg.EtcdS3SkipSSLVerify,
|
||||
Retention: cfg.EtcdS3Retention,
|
||||
Timeout: metav1.Duration{Duration: cfg.EtcdS3Timeout},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user