Commit 254b5207 authored by Brian Downs's avatar Brian Downs

add retention default and wire in s3 prune

parent 7e175e8a
......@@ -122,7 +122,7 @@ func NewEtcdSnapshotSubcommands(delete, list, prune, save func(ctx *cli.Context)
Action: prune,
Flags: append(EtcdSnapshotFlags, &cli.IntFlag{
Name: "snapshot-retention",
Usage: "(db) Number of snapshots to retain",
Usage: "(db) Number of snapshots to retain. Default: 5",
Destination: &ServerConfig.EtcdSnapshotRetention,
Value: defaultSnapshotRentention,
}),
......
......@@ -252,7 +252,7 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
},
&cli.IntFlag{
Name: "etcd-snapshot-retention",
Usage: "(db) Number of snapshots to retain",
Usage: "(db) Number of snapshots to retain Default: 5",
Destination: &ServerConfig.EtcdSnapshotRetention,
Value: defaultSnapshotRentention,
},
......
......@@ -978,6 +978,14 @@ func (e *ETCD) PruneSnapshots(ctx context.Context) error {
return errors.Wrap(err, "failed to get the snapshot dir")
}
if e.config.EtcdS3 {
if e.initS3IfNil(ctx); err != nil {
return err
}
return e.s3.snapshotRetention(ctx)
}
return snapshotRetention(e.config.EtcdSnapshotRetention, snapshotDir)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment