add ID to repo snapshot

Signed-off-by: Yonghui Li <lyonghui@vmware.com>
This commit is contained in:
Yonghui Li
2026-09-08 18:15:34 +08:00
parent a7f836051e
commit 8e604b17b2
7 changed files with 21 additions and 19 deletions
@@ -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(),
+1
View File
@@ -98,6 +98,7 @@ type Metadata struct {
}
type Snapshot struct {
ID ID
Source string
Description string
StartTime time.Time