mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-25 17:34:17 +00:00
add ID to repo snapshot
Signed-off-by: Yonghui Li <lyonghui@vmware.com>
This commit is contained in:
@@ -712,6 +712,7 @@ func (kr *kopiaRepository) GetSnapshot(ctx context.Context, id udmrepo.ID) (udmr
|
||||
}
|
||||
|
||||
return udmrepo.Snapshot{
|
||||
ID: udmrepo.ID(snap.ID),
|
||||
Source: snap.Source.Path,
|
||||
Description: snap.Description,
|
||||
StartTime: snap.StartTime.ToTime(),
|
||||
@@ -751,6 +752,7 @@ func (kr *kopiaRepository) ListSnapshot(ctx context.Context, source string) ([]u
|
||||
snapshots := []udmrepo.Snapshot{}
|
||||
for _, snap := range mani {
|
||||
snapshots = append(snapshots, udmrepo.Snapshot{
|
||||
ID: udmrepo.ID(snap.ID),
|
||||
Source: snap.Source.Path,
|
||||
Description: snap.Description,
|
||||
StartTime: snap.StartTime.ToTime(),
|
||||
|
||||
@@ -1609,6 +1609,7 @@ func TestGetSnapshot(t *testing.T) {
|
||||
snapshotID: udmrepo.ID("fake-id"),
|
||||
setRepoMock: true,
|
||||
expectedSnap: udmrepo.Snapshot{
|
||||
ID: "fake-id",
|
||||
Source: "fake-source",
|
||||
Description: "fake-desc",
|
||||
StartTime: mockMani.StartTime.ToTime(),
|
||||
@@ -1805,6 +1806,7 @@ func TestListSnapshot(t *testing.T) {
|
||||
setRepoMock: true,
|
||||
expectedSnaps: []udmrepo.Snapshot{
|
||||
{
|
||||
ID: "fake-id",
|
||||
Source: "fake-source",
|
||||
Description: "fake-desc",
|
||||
StartTime: mockMani.StartTime.ToTime(),
|
||||
|
||||
@@ -98,6 +98,7 @@ type Metadata struct {
|
||||
}
|
||||
|
||||
type Snapshot struct {
|
||||
ID ID
|
||||
Source string
|
||||
Description string
|
||||
StartTime time.Time
|
||||
|
||||
Reference in New Issue
Block a user