diff --git a/controllers/fenceagentsremediation_controller.go b/controllers/fenceagentsremediation_controller.go index 80d44d07..c1fc4192 100644 --- a/controllers/fenceagentsremediation_controller.go +++ b/controllers/fenceagentsremediation_controller.go @@ -155,6 +155,11 @@ func (r *FenceAgentsRemediationReconciler) Reconcile(ctx context.Context, req ct r.Log.Info("Finalizer was removed", "CR Name", req.Name) return emptyResult, nil } + // Add FAR (medik8s) remediation taint + r.Log.Info("Try adding FAR (Medik8s) remediation taint", "Fence Agent", far.Spec.Agent, "Node Name", req.Name) + if err := utils.AppendTaint(r.Client, far.Name); err != nil { + return emptyResult, err + } if meta.IsStatusConditionTrue(far.Status.Conditions, commonConditions.ProcessingType) && !meta.IsStatusConditionTrue(far.Status.Conditions, v1alpha1.FenceAgentActionSucceededType) { @@ -177,11 +182,7 @@ func (r *FenceAgentsRemediationReconciler) Reconcile(ctx context.Context, req ct r.Log.Error(err, "Invalid sharedParameters/nodeParameters from CR - edit/recreate the CR", "CR's Name", req.Name) return emptyResult, nil } - // Add FAR (medik8s) remediation taint - r.Log.Info("Try adding FAR (Medik8s) remediation taint", "Fence Agent", far.Spec.Agent, "Node Name", req.Name) - if err := utils.AppendTaint(r.Client, far.Name); err != nil { - return emptyResult, err - } + cmd := append([]string{far.Spec.Agent}, faParams...) // The Fence Agent is excutable and the parameters structure are valid, but we don't check their values r.Log.Info("Execute the fence agent", "Fence Agent", far.Spec.Agent, "Node Name", req.Name)