Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e9644edbd |
@@ -28,7 +28,8 @@ the tag exists and is exercised; what is left is merging `next` to
|
||||
warning that the snapshot's metadata was left on the destination store
|
||||
went to stdout ahead of the document, breaking `| jq` on a command that
|
||||
exited 0. Under `--json` the warning now reaches stderr only, through
|
||||
the logger.
|
||||
the logger, whose record now also says to run `vaultik prune` once the
|
||||
destination store is reachable.
|
||||
|
||||
- 2026-10-06: Made command output follow the README's stdout and stderr
|
||||
rules ([issue #224](https://git.eeqj.de/sneak/vaultik/issues/224)). The
|
||||
|
||||
@@ -91,7 +91,8 @@ func TestEntryJSONFailureIsReportedOnStderr(t *testing.T) {
|
||||
// --json` against a destination directory that does not exist. The
|
||||
// command still exits 0 after removing the snapshot from the local
|
||||
// index. Its stdout must hold the document alone, with the warning
|
||||
// about the destination store on stderr.
|
||||
// about the destination store, and the `vaultik prune` follow-up, on
|
||||
// stderr.
|
||||
//
|
||||
//nolint:paralleltest // replaces os.Args, os.Stdout, os.Stderr and the xdg globals
|
||||
func TestEntrySnapshotRemoveJSONWarningIsOnStderr(t *testing.T) {
|
||||
@@ -104,6 +105,7 @@ func TestEntrySnapshotRemoveJSONWarningIsOnStderr(t *testing.T) {
|
||||
requireExactlyOneJSONDocument(t, stdout)
|
||||
assert.Contains(t, stderr,
|
||||
"Could not remove snapshot metadata from remote storage")
|
||||
assert.Contains(t, stderr, "run 'vaultik prune'")
|
||||
}
|
||||
|
||||
// writeMissingDestinationConfig builds a config whose destination
|
||||
|
||||
@@ -1260,8 +1260,9 @@ func (v *Vaultik) removeSnapshotRemote(snapshotID string, opts *RemoveOptions) b
|
||||
|
||||
err := v.deleteRemoteSnapshotByKey(remoteKey)
|
||||
if err != nil {
|
||||
log.Warn("Could not remove snapshot metadata from remote storage",
|
||||
"error", err)
|
||||
log.Warn("Could not remove snapshot metadata from remote storage; "+
|
||||
"run '"+pruneCommandHint+"' once the remote is reachable "+
|
||||
"to finish cleanup", "error", err)
|
||||
|
||||
// The UI writes to stdout, which under --json holds only the
|
||||
// document; the log record above is the warning on stderr.
|
||||
|
||||
Reference in New Issue
Block a user