Skip to content

Commit

Permalink
fix: etcd snapshot command on Windows
Browse files Browse the repository at this point in the history
Close file before renaming

Signed-off-by: Jon Stelly <967068+jonstelly@users.noreply.github.com>
  • Loading branch information
jonstelly committed Jun 24, 2022
1 parent 103c942 commit 49a5dc5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/talosctl/cmd/talos/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ var etcdSnapshotCmd = &cobra.Command{
return fmt.Errorf("sha256 checksum not found (size %d)", size)
}

if err = dest.Close(); err != nil {
return fmt.Errorf("failed to close: %w", err)
}

if err = os.Rename(partPath, dbPath); err != nil {
return fmt.Errorf("error renaming to final location: %w", err)
}
Expand Down

0 comments on commit 49a5dc5

Please sign in to comment.