talos icon indicating copy to clipboard operation
talos copied to clipboard

Fix for etcd snapshot on windows

Open jonstelly opened this issue 2 years ago • 2 comments

Pull Request

What? (description)

Fix talosctl etcd snapshot on windows. Before PR change, executing ./talosctl.exe etcd snapshot ./etcd.db on windows would give me:

error renaming to final location: rename ./etcd.db.part ./etcd.db: The process cannot access the file because it is being used by another process.

Why? (reasoning)

Standard windows file locking issue, dest not being closed before trying to re-open it for the os.Rename().

Acceptance

I didn't quite get my environment all the way set up, make conformance and make unit-tests isn't running locally, but I did build talosctl with my change and verify it fixed my issue and generated an etcd snapshot.

Please use the following checklist:

  • [ ] you linked an issue (if applicable)
  • [ ] you included tests (if applicable)
  • [ ] you ran conformance (make conformance)
  • [x] you formatted your code (make fmt)
  • [x] you linted your code (make lint)
  • [x] you generated documentation (make docs)
  • [ ] you ran unit-tests (make unit-tests)

See make help for a description of the available targets.


This change is Reviewable

jonstelly avatar Jun 24 '22 04:06 jonstelly

could you please fix your commit message to include the DCO?

git commit --amend -s

and make it something like: fix: etcd snapshot command on Windows with some non-empty commit body?

smira avatar Jun 24 '22 14:06 smira

/ok-to-test

smira avatar Jun 24 '22 14:06 smira

/m

smira avatar Oct 28 '22 11:10 smira