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-22 21:52:35 +03:00 committed by GitHub
parent 9db4f02289
commit 3601a07879
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -103,7 +103,7 @@ func SaveWithVersion(ctx context.Context, lg *zap.Logger, cfg clientv3.Config, d
return "", fmt.Errorf("could not open %s (%v)", partPath, err)
}
lg.Info("created temporary db file", zap.String("path", partPath))
defer os.RemoveAll(partPath)
defer f.Close()