mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-20 06:54:32 +00:00
controllers support message in progress
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
This commit is contained in:
@@ -42,7 +42,6 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/predicate"
|
||||
"sigs.k8s.io/controller-runtime/pkg/reconcile"
|
||||
|
||||
"github.com/vmware-tanzu/velero/pkg/apis/velero/shared"
|
||||
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
|
||||
velerov2alpha1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v2alpha1"
|
||||
"github.com/vmware-tanzu/velero/pkg/constant"
|
||||
@@ -634,7 +633,19 @@ func (r *DataUploadReconciler) OnDataUploadProgress(ctx context.Context, namespa
|
||||
log := r.logger.WithField("dataupload", duName)
|
||||
|
||||
if err := UpdateDataUploadWithRetry(ctx, r.client, types.NamespacedName{Namespace: namespace, Name: duName}, log, func(du *velerov2alpha1api.DataUpload) bool {
|
||||
du.Status.Progress = shared.DataMoveOperationProgress{TotalBytes: progress.TotalBytes, BytesDone: progress.BytesDone}
|
||||
if progress.TotalBytes != -1 {
|
||||
du.Status.Progress.TotalBytes = progress.TotalBytes
|
||||
}
|
||||
|
||||
if progress.BytesDone != -1 {
|
||||
du.Status.Progress.BytesDone = progress.BytesDone
|
||||
}
|
||||
|
||||
if progress.Message != "" {
|
||||
du.Status.Message += progress.Message
|
||||
du.Status.Message += ";"
|
||||
}
|
||||
|
||||
return true
|
||||
}); err != nil {
|
||||
log.WithError(err).Error("Failed to update progress")
|
||||
|
||||
Reference in New Issue
Block a user