hashicorp / hashicorp/nomad

nomad snapshot does not overwrite file

Open
#9,197 3 comments 1 reaction 0 assignees View on GitHub
stage/needs-discussion type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version
Output from `nomad version`
Nomad v0.12.7 (6147cb578794cb2d0c35d68fe1791728a09bb081)

### Operating system and Environment details
CentOS Linux release 7.8.2003 (Core)

### Issue

`nomad operator snapshot save /tmp/nomad.snapshot` fails with:

```
Destination file already exists: "/tmp/nomad.snapshot"
For additional help try 'nomad operator snapshot save -help'
```

### Reproduction steps

1 - Run the command for the first time, it succeeds.
2 - Run it once again and it fails

This operation should resemble the same behaviour as `consul snapshot` does, overwriting the specified file.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing `nomad operator snapshot save /tmp/nomad.snapshot` twice and inspect the CLI entry point for the snapshot save command. Compare its existing-file handling with the reported Consul behavior. Done means a second save overwrites the specified snapshot file without the current destination-exists error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.