mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 11:45:20 +00:00
BIA/RIAv2 -- distinguish between New and InProgress operations
Signed-off-by: Scott Seago <sseago@redhat.com>
This commit is contained in:
@@ -270,7 +270,8 @@ func getRestoreItemOperationProgress(
|
||||
var completedCount, failedCount int
|
||||
|
||||
for _, operation := range operationsList {
|
||||
if operation.Status.Phase == itemoperation.OperationPhaseInProgress {
|
||||
if operation.Status.Phase == itemoperation.OperationPhaseNew ||
|
||||
operation.Status.Phase == itemoperation.OperationPhaseInProgress {
|
||||
ria, err := pluginManager.GetRestoreItemActionV2(operation.Spec.RestoreItemAction)
|
||||
if err != nil {
|
||||
operation.Status.Phase = itemoperation.OperationPhaseFailed
|
||||
@@ -306,12 +307,14 @@ func getRestoreItemOperationProgress(
|
||||
changes = true
|
||||
}
|
||||
started := metav1.NewTime(operationProgress.Started)
|
||||
if operation.Status.Started == nil || *(operation.Status.Started) != started {
|
||||
if operation.Status.Started == nil && !operationProgress.Started.IsZero() ||
|
||||
operation.Status.Started != nil && *(operation.Status.Started) != started {
|
||||
operation.Status.Started = &started
|
||||
changes = true
|
||||
}
|
||||
updated := metav1.NewTime(operationProgress.Updated)
|
||||
if operation.Status.Updated == nil || *(operation.Status.Updated) != updated {
|
||||
if operation.Status.Updated == nil && !operationProgress.Updated.IsZero() ||
|
||||
operation.Status.Updated != nil && *(operation.Status.Updated) != updated {
|
||||
operation.Status.Updated = &updated
|
||||
changes = true
|
||||
}
|
||||
@@ -340,6 +343,11 @@ func getRestoreItemOperationProgress(
|
||||
failedCount++
|
||||
continue
|
||||
}
|
||||
if operation.Status.Phase == itemoperation.OperationPhaseNew &&
|
||||
operation.Status.Started != nil {
|
||||
operation.Status.Phase = itemoperation.OperationPhaseInProgress
|
||||
changes = true
|
||||
}
|
||||
// if we reach this point, the operation is still running
|
||||
inProgressOperations = true
|
||||
} else if operation.Status.Phase == itemoperation.OperationPhaseCompleted {
|
||||
|
||||
Reference in New Issue
Block a user