Skip to content

Commit

Permalink
fix taskrun no node found
Browse files Browse the repository at this point in the history
  • Loading branch information
shaowenchen committed Dec 27, 2024
1 parent 9b87fcd commit de0ffa3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controllers/taskrun_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ func (r *TaskRunReconciler) runTaskOnKube(logger *opslog.Logger, ctx context.Con
Namespace: opsconstants.OpsNamespace,
}
// run
if kubeOpt.NodeName == "" {
kubeOpt.NodeName = opsconstants.AnyWorker
}
nodes, err := opskube.GetNodes(ctx, logger, kc.Client, kubeOpt)
if err != nil || len(nodes) == 0 {
r.commitStatus(logger, ctx, tr, opsconstants.StatusFailed)
Expand Down

0 comments on commit de0ffa3

Please sign in to comment.