Merge pull request #9875 from Lyndon-Li/repo-snapshot-operation-enhance
Run the E2E test on kind / get-go-version (push) Failing after 1m11s
Run the E2E test on kind / build (push) Has been skipped
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / get-go-version (push) Successful in 18s
Main CI / Build (push) Failing after 40s
Close stale issues and PRs / stale (push) Successful in 14s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 1m47s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 1m24s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 1m23s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 1m22s

Repo snapshot operation enhance
This commit is contained in:
lyndon-li
2026-06-03 14:13:04 +08:00
committed by GitHub
3 changed files with 10 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
Add totalSize to repo snapshot operation; and pin unified repo snapshots to Kopia repository and so pin them with Velero backup lifecycle
@@ -626,6 +626,9 @@ func (kr *kopiaRepository) SaveSnapshot(ctx context.Context, snap udmrepo.Snapsh
Description: snap.Description,
StartTime: fs.UTCTimestampFromTime(snap.StartTime),
EndTime: fs.UTCTimestampFromTime(snap.EndTime),
Stats: snapshot.Stats{
TotalFileSize: snap.TotalSize,
},
RootEntry: &snapshot.DirEntry{
Type: snapshot.EntryTypeDirectory,
ObjectID: rootObj,
@@ -634,8 +637,12 @@ func (kr *kopiaRepository) SaveSnapshot(ctx context.Context, snap udmrepo.Snapsh
FileSize: snap.RootObject.Size,
UserID: snap.RootObject.UserID,
GroupID: snap.RootObject.GroupID,
DirSummary: &fs.DirectorySummary{
TotalFileSize: snap.TotalSize,
},
},
Tags: snap.Tags,
Pins: []string{"velero-pin"}, // pins are meant to prevent snapshot from automatic expiration/deletion.
}
id, err := snapshot.SaveSnapshot(ctx, kr.rawWriter, &manifest)
@@ -662,6 +669,7 @@ func (kr *kopiaRepository) GetSnapshot(ctx context.Context, id udmrepo.ID) (udmr
StartTime: snap.StartTime.ToTime(),
EndTime: snap.EndTime.ToTime(),
Tags: snap.Tags,
TotalSize: snap.Stats.TotalFileSize,
RootObject: udmrepo.ObjectMetadata{
ID: udmrepo.ID(snap.RootEntry.ObjectID.String()),
Type: udmrepo.ObjectDataTypeMetadata,
+1
View File
@@ -98,6 +98,7 @@ type Snapshot struct {
StartTime time.Time
EndTime time.Time
Tags map[string]string
TotalSize int64
RootObject ObjectMetadata
}