Skip to content

Commit

Permalink
Working to get task to fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles-Garnsey committed Aug 30, 2024
1 parent b7d501e commit 2e12fcc
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions internal/controllers/control/cassandratask_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down

0 comments on commit 2e12fcc

Please sign in to comment.