etcdctl: add etcdctl snapshot pipe command

To improve the security of etcdctl. Added the ability to write snapshots to stdout without writing data to disk.

Signed-off-by: Ais8Ooz8 <47941654+Ais8Ooz8@users.noreply.github.com>
This commit is contained in:
Ais8Ooz8 2024-03-26 19:34:20 +03:00 committed by GitHub
parent 8975ef0a95
commit 2ddb9f40a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View File

@ -28,6 +28,7 @@ See [code changes](https://github.com/etcd-io/etcd/compare/v3.5.0...v3.6.0).
### etcdctl v3
- Add command to generate [shell completion](https://github.com/etcd-io/etcd/pull/13133).
- Add command [snapshot pipe](https://github.com/etcd-io/etcd/pull/16243).
- When print endpoint status, [show db size in use](https://github.com/etcd-io/etcd/pull/13639)
- [Always print the raft_term in decimal](https://github.com/etcd-io/etcd/pull/13711) when displaying member list in json.
- [Add one more field `storageVersion`](https://github.com/etcd-io/etcd/pull/13773) into the response of command `etcdctl endpoint status`.

View File

@ -44,7 +44,7 @@ func hasChecksum(n int64) bool {
// context.DeadlineExceeded). Make sure to specify only one endpoint
// in client configuration. Snapshot API must be requested to a
// selected node, and saved snapshot is the point-in-time state of
// the selected node. Etcd < v3.6 will return "" as version.
// the selected node. Nota bene: etcd < v3.6 will return "" as version.
func WriteSnapshotWithVersion(ctx context.Context, lg *zap.Logger, cfg clientv3.Config, f *os.File) (string, error) {
cfg.Logger = lg.Named("client")
if len(cfg.Endpoints) != 1 {

View File

@ -1024,7 +1024,7 @@ The backend snapshot is written to stdout.
Write a snapshot to stdout:
```
./etcdctl snapshot pipe
./etcdctl snapshot pipe > snapshot.db
```
### SNAPSHOT SAVE \<filename\>