From 694900672494825e53ec6cb41d5b30730e079216 Mon Sep 17 00:00:00 2001 From: ColdsteelRail <574252631@qq.com> Date: Wed, 9 Oct 2024 15:12:17 +0800 Subject: [PATCH] remove unused codes --- pkg/controllers/operationjob/operationjob_controller.go | 1 - pkg/controllers/operationjob/utils/common.go | 9 --------- 2 files changed, 10 deletions(-) diff --git a/pkg/controllers/operationjob/operationjob_controller.go b/pkg/controllers/operationjob/operationjob_controller.go index 4538fc32..464fb52a 100644 --- a/pkg/controllers/operationjob/operationjob_controller.go +++ b/pkg/controllers/operationjob/operationjob_controller.go @@ -117,7 +117,6 @@ func (r *ReconcileOperationJob) Reconcile(ctx context.Context, req reconcile.Req return reconcile.Result{Requeue: true}, nil } - //actionHandler, enablePodOpsLifecycle := r.getActionHandler(instance) candidates, err := r.listTargets(ctx, instance) if err != nil { return reconcile.Result{}, err diff --git a/pkg/controllers/operationjob/utils/common.go b/pkg/controllers/operationjob/utils/common.go index 64f40dba..38acdb67 100644 --- a/pkg/controllers/operationjob/utils/common.go +++ b/pkg/controllers/operationjob/utils/common.go @@ -29,7 +29,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "kusionstack.io/kuperator/pkg/controllers/operationjob/opscore" - ctrlutils "kusionstack.io/kuperator/pkg/controllers/utils" ) const ( @@ -37,14 +36,6 @@ const ( ReasonGetObjectFailed = "GetObjectFailed" ) -func MarkOperationJobFailed(instance *appsv1alpha1.OperationJob) { - if instance.Status.Progress != appsv1alpha1.OperationProgressSucceeded { - now := ctrlutils.FormatTimeNow() - instance.Status.Progress = appsv1alpha1.OperationProgressFailed - instance.Status.EndTimestamp = &now - } -} - func MapOpsStatusByPod(instance *appsv1alpha1.OperationJob) map[string]*appsv1alpha1.OpsStatus { opsStatusMap := make(map[string]*appsv1alpha1.OpsStatus) for i, opsStatus := range instance.Status.TargetDetails {