mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-13 11:34:54 +00:00
@@ -177,6 +177,10 @@ type DataUploadStatus struct {
|
||||
// +optional
|
||||
IncrementalBytes *int64 `json:"incrementalBytes,omitempty"`
|
||||
|
||||
// SourceSize holds the total size of the source volume.
|
||||
// +optional
|
||||
SourceSize int64 `json:"sourceSize,omitempty"`
|
||||
|
||||
// Node is name of the node where the DataUpload is processed.
|
||||
// +optional
|
||||
Node string `json:"node,omitempty"`
|
||||
|
||||
@@ -514,6 +514,8 @@ func (r *DataUploadReconciler) OnDataUploadCompleted(ctx context.Context, namesp
|
||||
du.Status.Phase = velerov2alpha1api.DataUploadPhaseCompleted
|
||||
du.Status.SnapshotID = result.Backup.SnapshotID
|
||||
du.Status.IncrementalBytes = result.Backup.IncrementalBytes
|
||||
du.Status.SourceSize = result.Backup.SourceSize
|
||||
|
||||
du.Status.CompletionTimestamp = &metav1.Time{Time: r.Clock.Now()}
|
||||
if result.Backup.EmptySnapshot {
|
||||
du.Status.Message = "volume was empty so no data was upload"
|
||||
|
||||
@@ -197,7 +197,7 @@ func (dp *generalDataPath) StartBackup(source AccessPoint, uploaderConfig map[st
|
||||
dp.wgDataPath.Done()
|
||||
}()
|
||||
|
||||
snapshotID, emptySnapshot, totalBytes, incrementalBytes, err := dp.uploaderProv.RunBackup(
|
||||
snapshotID, emptySnapshot, totalBytes, incrementalBytes, sourceSize, err := dp.uploaderProv.RunBackup(
|
||||
dp.ctx,
|
||||
source.ByPath,
|
||||
backupParam.RealSource,
|
||||
@@ -226,7 +226,14 @@ func (dp *generalDataPath) StartBackup(source AccessPoint, uploaderConfig map[st
|
||||
}
|
||||
dp.callbacks.OnFailed(context.Background(), dp.namespace, dp.jobName, dataPathErr)
|
||||
} else {
|
||||
dp.callbacks.OnCompleted(context.Background(), dp.namespace, dp.jobName, Result{Backup: BackupResult{snapshotID, emptySnapshot, source, totalBytes, ptr.To(incrementalBytes)}})
|
||||
dp.callbacks.OnCompleted(context.Background(), dp.namespace, dp.jobName, Result{Backup: BackupResult{
|
||||
SnapshotID: snapshotID,
|
||||
EmptySnapshot: emptySnapshot,
|
||||
Source: source,
|
||||
TotalBytes: totalBytes,
|
||||
IncrementalBytes: ptr.To(incrementalBytes),
|
||||
SourceSize: sourceSize,
|
||||
}})
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ type BackupResult struct {
|
||||
// while a current mover reporting a genuine zero still serializes the key and
|
||||
// unmarshals to a non-nil zero, distinguishing "measured zero" from "not measured".
|
||||
IncrementalBytes *int64 `json:"incrementalBytes,omitempty"`
|
||||
SourceSize int64 `json:"sourceSize,omitempty"`
|
||||
}
|
||||
|
||||
// RestoreResult represents the result of a restore
|
||||
|
||||
Reference in New Issue
Block a user