diff --git a/deploy/crds/planetscale.com_vitessbackupschedules.yaml b/deploy/crds/planetscale.com_vitessbackupschedules.yaml index 3a293750..b0b5e6af 100644 --- a/deploy/crds/planetscale.com_vitessbackupschedules.yaml +++ b/deploy/crds/planetscale.com_vitessbackupschedules.yaml @@ -42,7 +42,6 @@ spec: enum: - Allow - Forbid - - Replace example: Forbid type: string failedJobsHistoryLimit: diff --git a/deploy/crds/planetscale.com_vitessclusters.yaml b/deploy/crds/planetscale.com_vitessclusters.yaml index 9ecc375b..818304f1 100644 --- a/deploy/crds/planetscale.com_vitessclusters.yaml +++ b/deploy/crds/planetscale.com_vitessclusters.yaml @@ -168,7 +168,6 @@ spec: enum: - Allow - Forbid - - Replace example: Forbid type: string failedJobsHistoryLimit: diff --git a/pkg/apis/planetscale/v2/vitessbackupschedule_types.go b/pkg/apis/planetscale/v2/vitessbackupschedule_types.go index b25e6d54..ff29654d 100644 --- a/pkg/apis/planetscale/v2/vitessbackupschedule_types.go +++ b/pkg/apis/planetscale/v2/vitessbackupschedule_types.go @@ -23,7 +23,7 @@ import ( // ConcurrencyPolicy describes how the concurrency of new jobs created by VitessBackupSchedule // is handled, the default is set to AllowConcurrent. -// +kubebuilder:validation:Enum=Allow;Forbid;Replace +// +kubebuilder:validation:Enum=Allow;Forbid type ConcurrencyPolicy string const ( @@ -32,9 +32,6 @@ const ( // ForbidConcurrent forbids concurrent runs, skipping next run if previous hasn't finished yet. ForbidConcurrent ConcurrencyPolicy = "Forbid" - - // ReplaceConcurrent cancels currently running job and replaces it with a new one. - ReplaceConcurrent ConcurrencyPolicy = "Replace" ) // BackupStrategyName describes the vtctldclient command that will be used to take a backup. diff --git a/pkg/controller/vitessbackupschedule/vitessbackupschedule_controller.go b/pkg/controller/vitessbackupschedule/vitessbackupschedule_controller.go index a418dfa6..aff7a7f7 100644 --- a/pkg/controller/vitessbackupschedule/vitessbackupschedule_controller.go +++ b/pkg/controller/vitessbackupschedule/vitessbackupschedule_controller.go @@ -236,16 +236,6 @@ func (r *ReconcileVitessBackupsSchedule) Reconcile(ctx context.Context, req ctrl return scheduledResult, nil } - // Check concurrency policy to know if we should replace existing jobs - if vbsc.Spec.ConcurrencyPolicy == planetscalev2.ReplaceConcurrent { - for _, activeJob := range jobs.active { - if err = r.client.Delete(ctx, activeJob, client.PropagationPolicy(metav1.DeletePropagationBackground)); client.IgnoreNotFound(err) != nil { - log.WithError(err).Errorf("unable to delete active job: %s", activeJob.Name) - return ctrl.Result{}, err - } - } - } - // Now that the different policies are checked, we can create and apply our new job. job, err := r.createJob(ctx, &vbsc, missedRun) if err != nil { diff --git a/test/endtoend/operator/operator-latest.yaml b/test/endtoend/operator/operator-latest.yaml index c363780d..b2e6122f 100644 --- a/test/endtoend/operator/operator-latest.yaml +++ b/test/endtoend/operator/operator-latest.yaml @@ -422,7 +422,6 @@ spec: enum: - Allow - Forbid - - Replace example: Forbid type: string failedJobsHistoryLimit: @@ -1657,7 +1656,6 @@ spec: enum: - Allow - Forbid - - Replace example: Forbid type: string failedJobsHistoryLimit: diff --git a/test/endtoend/operator/operator.yaml b/test/endtoend/operator/operator.yaml index c2c0523a..755a1635 100644 --- a/test/endtoend/operator/operator.yaml +++ b/test/endtoend/operator/operator.yaml @@ -422,7 +422,6 @@ spec: enum: - Allow - Forbid - - Replace example: Forbid type: string failedJobsHistoryLimit: @@ -1657,7 +1656,6 @@ spec: enum: - Allow - Forbid - - Replace example: Forbid type: string failedJobsHistoryLimit: