mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-20 06:54:32 +00:00
Fix usestdlibvars and whitespace linters issues. (#6162)
Signed-off-by: Xun Jiang <blackpiglet@gmail.com> Co-authored-by: Xun Jiang <blackpiglet@gmail.com>
This commit is contained in:
co-authored by
Xun Jiang
parent
14f31eed8c
commit
1fd28e8a36
@@ -118,7 +118,6 @@ func NewBackupReconciler(
|
||||
credentialStore credentials.FileStore,
|
||||
maxConcurrentK8SConnections int,
|
||||
) *backupReconciler {
|
||||
|
||||
b := &backupReconciler{
|
||||
ctx: ctx,
|
||||
discoveryHelper: discoveryHelper,
|
||||
|
||||
@@ -215,7 +215,6 @@ func (c *backupOperationsReconciler) updateBackupAndOperationsJSON(
|
||||
operations *itemoperationmap.OperationsForBackup,
|
||||
changes bool,
|
||||
completionChanges bool) error {
|
||||
|
||||
backupScheduleName := backup.GetLabels()[velerov1api.ScheduleNameLabel]
|
||||
|
||||
if len(operations.ErrsSinceUpdate) > 0 {
|
||||
@@ -229,7 +228,6 @@ func (c *backupOperationsReconciler) updateBackupAndOperationsJSON(
|
||||
backup.Status.Phase == velerov1api.BackupPhasePartiallyFailed ||
|
||||
backup.Status.Phase == velerov1api.BackupPhaseFinalizing ||
|
||||
backup.Status.Phase == velerov1api.BackupPhaseFinalizingPartiallyFailed) {
|
||||
|
||||
c.itemOperationsMap.DeleteOperationsForBackup(backup.Name)
|
||||
} else if changes {
|
||||
c.itemOperationsMap.PutOperationsForBackup(operations, backup.Name)
|
||||
|
||||
@@ -152,7 +152,6 @@ func (b *backupSyncReconciler) Reconcile(ctx context.Context, req ctrl.Request)
|
||||
backup.Status.Phase == velerov1api.BackupPhaseWaitingForPluginOperationsPartiallyFailed ||
|
||||
backup.Status.Phase == velerov1api.BackupPhaseFinalizing ||
|
||||
backup.Status.Phase == velerov1api.BackupPhaseFinalizingPartiallyFailed {
|
||||
|
||||
if backup.Status.Expiration == nil || backup.Status.Expiration.After(time.Now()) {
|
||||
log.Debugf("Skipping non-expired incomplete backup %v", backup.Name)
|
||||
continue
|
||||
|
||||
@@ -104,7 +104,6 @@ func (r *downloadRequestReconciler) Reconcile(ctx context.Context, req ctrl.Requ
|
||||
|
||||
if downloadRequest.Status != (velerov1api.DownloadRequestStatus{}) && downloadRequest.Status.Expiration != nil {
|
||||
if downloadRequest.Status.Expiration.Time.Before(r.clock.Now()) {
|
||||
|
||||
// Delete any request that is expired, regardless of the phase: it is not
|
||||
// worth proceeding and trying/retrying to find it.
|
||||
log.Debug("DownloadRequest has expired - deleting")
|
||||
@@ -113,9 +112,7 @@ func (r *downloadRequestReconciler) Reconcile(ctx context.Context, req ctrl.Requ
|
||||
return ctrl.Result{}, errors.WithStack(err)
|
||||
}
|
||||
return ctrl.Result{Requeue: false}, nil
|
||||
|
||||
} else if downloadRequest.Status.Phase == velerov1api.DownloadRequestPhaseProcessed {
|
||||
|
||||
// Requeue the request if is not yet expired and has already been processed before,
|
||||
// since it might still be in use by the logs streaming and shouldn't
|
||||
// be deleted until after its expiration.
|
||||
@@ -127,7 +124,6 @@ func (r *downloadRequestReconciler) Reconcile(ctx context.Context, req ctrl.Requ
|
||||
// Process a brand new request.
|
||||
backupName := downloadRequest.Spec.Target.Name
|
||||
if downloadRequest.Status.Phase == "" || downloadRequest.Status.Phase == velerov1api.DownloadRequestPhaseNew {
|
||||
|
||||
// Update the expiration.
|
||||
downloadRequest.Status.Expiration = &metav1.Time{Time: r.clock.Now().Add(persistence.DownloadURLTTL)}
|
||||
|
||||
|
||||
@@ -216,7 +216,6 @@ func (r *restoreOperationsReconciler) updateRestoreAndOperationsJSON(
|
||||
operations *itemoperationmap.OperationsForRestore,
|
||||
changes bool,
|
||||
completionChanges bool) error {
|
||||
|
||||
if len(operations.ErrsSinceUpdate) > 0 {
|
||||
// FIXME: download/upload results
|
||||
}
|
||||
@@ -225,7 +224,6 @@ func (r *restoreOperationsReconciler) updateRestoreAndOperationsJSON(
|
||||
// remove local operations list if complete
|
||||
if removeIfComplete && (restore.Status.Phase == velerov1api.RestorePhaseCompleted ||
|
||||
restore.Status.Phase == velerov1api.RestorePhasePartiallyFailed) {
|
||||
|
||||
r.itemOperationsMap.DeleteOperationsForRestore(restore.Name)
|
||||
} else if changes {
|
||||
r.itemOperationsMap.PutOperationsForRestore(operations, restore.Name)
|
||||
|
||||
Reference in New Issue
Block a user