From 2e12fcc0c9b57db13250fb5f96d481abf114d74f Mon Sep 17 00:00:00 2001 From: Miles Garnsey Date: Fri, 30 Aug 2024 17:03:08 +0200 Subject: [PATCH] Working to get task to fail. --- .../control/cassandratask_controller.go | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/controllers/control/cassandratask_controller.go b/internal/controllers/control/cassandratask_controller.go index b109595b..6aaa5627 100644 --- a/internal/controllers/control/cassandratask_controller.go +++ b/internal/controllers/control/cassandratask_controller.go @@ -785,6 +785,16 @@ func (r *CassandraTaskReconciler) reconcileEveryPodTask(ctx context.Context, dc return ctrl.Result{}, failed, completed, errMsg, err } + if taskConfig.SyncFeature != "" { + if !features.Supports(taskConfig.SyncFeature) { + logger.Error(err, "Pod doesn't support this feature", "Pod", pod, "Feature", taskConfig.SyncFeature) + jobStatus.Status = podJobError + failed++ + errMsg = fmt.Sprintf("Pod %s doesn't support %s feature", pod.Name, taskConfig.SyncFeature) + return ctrl.Result{}, failed, completed, errMsg, err + } + } + jobId := strconv.Itoa(idx) // This pod should run next, mark it @@ -801,16 +811,6 @@ func (r *CassandraTaskReconciler) reconcileEveryPodTask(ctx context.Context, dc return ctrl.Result{}, failed, completed, errMsg, err } - if taskConfig.SyncFeature != "" { - if !features.Supports(taskConfig.SyncFeature) { - logger.Error(err, "Pod doesn't support this feature", "Pod", pod, "Feature", taskConfig.SyncFeature) - jobStatus.Status = podJobError - failed++ - errMsg = fmt.Sprintf("Pod %s doesn't support %s feature", pod.Name, taskConfig.SyncFeature) - return ctrl.Result{}, failed, completed, errMsg, err - } - } - pod := pod go func() {