Skip to content

Commit 0ff01f7

Browse files
authored
Merge pull request #1232 from jcechace/PBM-1663-profile-ux-01
PBM-1663: Rename StorageName to Profile and always Include it
2 parents 66c9cab + dc31a39 commit 0ff01f7

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

cmd/pbm/backup.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ func waitForBcpStatus(ctx context.Context, conn connect.Client, bcpName string,
320320

321321
type bcpDesc struct {
322322
Name string `json:"name" yaml:"name"`
323+
Profile string `json:"profile,omitempty" yaml:"profile,omitempty"`
324+
StorageType storage.Type `json:"storage_type,omitempty" yaml:"storage_type,omitempty"`
323325
OPID string `json:"opid" yaml:"opid"`
324326
Type defs.BackupType `json:"type" yaml:"type"`
325327
LastWriteTS int64 `json:"last_write_ts" yaml:"-"`
@@ -335,7 +337,6 @@ type bcpDesc struct {
335337
SizeUncompressed int64 `json:"size_uncompressed" yaml:"-"`
336338
HSize string `json:"size_h" yaml:"size_h"`
337339
HSizeUncompressed string `json:"size_uncompressed_h" yaml:"size_uncompressed_h"`
338-
StorageName string `json:"storage_name,omitempty" yaml:"storage_name,omitempty"`
339340
Err *string `json:"error,omitempty" yaml:"error,omitempty"`
340341
Replsets []bcpReplDesc `json:"replsets" yaml:"replsets"`
341342
}
@@ -413,6 +414,8 @@ func describeBackup(
413414

414415
rv := &bcpDesc{
415416
Name: bcp.Name,
417+
Profile: bcp.Store.Name,
418+
StorageType: bcp.Store.Type,
416419
OPID: bcp.OPID,
417420
Type: bcp.Type,
418421
Namespaces: bcp.Namespaces,
@@ -428,7 +431,6 @@ func describeBackup(
428431
HSize: byteCountIEC(bcp.Size),
429432
SizeUncompressed: bcp.SizeUncompressed,
430433
HSizeUncompressed: byteCountIEC(bcp.SizeUncompressed),
431-
StorageName: bcp.Store.Name,
432434
}
433435
if bcp.SizeUncompressed > 0 {
434436
rv.HSizeUncompressed = byteCountIEC(bcp.SizeUncompressed)

cmd/pbm/list.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ func (bl backupListOut) String() string {
213213
} else if b.Type == defs.IncrementalBackup && b.SrcBackup == "" {
214214
t += ", base"
215215
}
216-
if b.StoreName != "" {
217-
t += ", *"
216+
if b.Profile != "" {
217+
t += ", " + b.Profile
218218
}
219219
s += fmt.Sprintf(" %s <%s> [restore_to_time: %s]\n", b.Name, t, fmtTS(int64(b.RestoreTS)))
220220
}
@@ -322,7 +322,7 @@ func getSnapshotList(
322322
PBMVersion: b.PBMVersion,
323323
Type: b.Type,
324324
SrcBackup: b.SrcBackup,
325-
StoreName: b.Store.Name,
325+
Profile: b.Store.Name,
326326
})
327327
}
328328

cmd/pbm/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,7 @@ func tsUTC(ts int64) string {
11431143

11441144
type snapshotStat struct {
11451145
Name string `json:"name"`
1146+
Profile string `json:"profile,omitempty"`
11461147
Namespaces []string `json:"nss,omitempty"`
11471148
Size int64 `json:"size,omitempty"`
11481149
Status defs.Status `json:"status"`
@@ -1153,7 +1154,6 @@ type snapshotStat struct {
11531154
PBMVersion string `json:"pbmVersion"`
11541155
Type defs.BackupType `json:"type"`
11551156
SrcBackup string `json:"src"`
1156-
StoreName string `json:"storage,omitempty"`
11571157
}
11581158

11591159
type pitrRange struct {

cmd/pbm/status.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,8 @@ func (s storageStat) String() string {
494494
} else if ss.Type == defs.IncrementalBackup && ss.SrcBackup == "" {
495495
t += ", base"
496496
}
497-
if ss.StoreName != "" {
498-
t += ", *"
497+
if ss.Profile != "" {
498+
t += ", " + ss.Profile
499499
}
500500
ret += fmt.Sprintf(" %s %s <%s> %s %s\n", ss.Name, storage.PrettySize(ss.Size), t, ss.PrintStatus, status)
501501
}
@@ -590,7 +590,7 @@ func getStorageStat(
590590
PBMVersion: bcp.PBMVersion,
591591
Type: bcp.Type,
592592
SrcBackup: bcp.SrcBackup,
593-
StoreName: bcp.Store.Name,
593+
Profile: bcp.Store.Name,
594594
}
595595
if err := bcp.Error(); err != nil {
596596
snpsht.Err = err

0 commit comments

Comments
 (0)