diff --git a/CHANGELOG.md b/CHANGELOG.md index d2b5a2c8e..602ec5c2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] (beta) +### Added +- Show owner information when doing backup list in json format + ## [v0.4.0] (alpha) - 2023-2-20 ### Fixed diff --git a/src/pkg/backup/backup.go b/src/pkg/backup/backup.go index 36e4b16ff..0044736bc 100644 --- a/src/pkg/backup/backup.go +++ b/src/pkg/backup/backup.go @@ -108,6 +108,7 @@ type Printable struct { Version string `json:"version"` BytesRead int64 `json:"bytesRead"` BytesUploaded int64 `json:"bytesUploaded"` + Owner string `json:"owner"` } // MinimumPrintable reduces the Backup to its minimally printable details. @@ -120,6 +121,7 @@ func (b Backup) MinimumPrintable() any { Version: "0", BytesRead: b.BytesRead, BytesUploaded: b.BytesUploaded, + Owner: b.Selector.DiscreteOwner, } } diff --git a/src/pkg/backup/backup_test.go b/src/pkg/backup/backup_test.go index 8fbf8c62f..6fb4536d4 100644 --- a/src/pkg/backup/backup_test.go +++ b/src/pkg/backup/backup_test.go @@ -102,4 +102,5 @@ func (suite *BackupSuite) TestBackup_MinimumPrintable() { assert.Equal(t, b.Status, result.Status, "status") assert.Equal(t, b.BytesRead, result.BytesRead, "size") assert.Equal(t, b.BytesUploaded, result.BytesUploaded, "stored size") + assert.Equal(t, b.Selector.DiscreteOwner, result.Owner, "owner") }