Skip to content

add LabelSelector for TaskRuns#750

Draft
filariow wants to merge 1 commit intokonflux-ci:mainfrom
filariow:taskrun-labelselector
Draft

add LabelSelector for TaskRuns#750
filariow wants to merge 1 commit intokonflux-ci:mainfrom
filariow:taskrun-labelselector

Conversation

@filariow
Copy link
Member

@filariow filariow commented Feb 3, 2026

This change introduces an optional LabelSelector field in MPC's configuration. The LabelSelector is used to calculate whether MPC should reconcile a TaskRun or not.

As an example, it can be used to validate that the PipelineRun behind the TaskRun was effectively added to a kueue's Queue by checking the presence of the kueue's kueue.x-k8s.io/queue-name label.

A check at boot time is added to make sure a new rollout fails if the configuration is not valid.

In case of malformed TaskRuns, the user experience will be of a Pending Pod waiting for the Secret to be created until the owner TaskRun times-out. This is the default behavior in MPC.

Signed-off-by: Francesco Ilario filario@redhat.com

assisted-by: Cursor

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

@snyk-io
Copy link

snyk-io bot commented Feb 3, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codecov-commenter
Copy link

codecov-commenter commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.32%. Comparing base (56a709a) to head (2a8b223).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #750      +/-   ##
==========================================
+ Coverage   49.02%   49.32%   +0.29%     
==========================================
  Files          20       21       +1     
  Lines        2707     2723      +16     
==========================================
+ Hits         1327     1343      +16     
  Misses       1250     1250              
  Partials      130      130              
Flag Coverage Δ
unit-tests 49.32% <100.00%> (+0.29%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This change introduces an optional `LabelSelector` field in MPC's
configuration. The LabelSelector is used to calculate whether MPC
should reconcile a TaskRun or not.

As an example, it can be used to validate that the PipelineRun
behind the TaskRun was effectively added to a kueue's Queue by
checking the presence of the kueue's `kueue.x-k8s.io/queue-name`
label.

A check at boot time is added to make sure a new rollout fails
if the configuration is not valid.

In case of malformed TaskRuns, the user experience will be of
a Pending Pod waiting for the Secret to be created until the
owner TaskRun times-out. This is the default behavior in MPC.

Signed-off-by: Francesco Ilario <filario@redhat.com>

assisted-by: Cursor

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@filariow filariow force-pushed the taskrun-labelselector branch from 59163ca to 2a8b223 Compare February 3, 2026 11:07
@gbenhaim
Copy link
Member

gbenhaim commented Feb 3, 2026

This will ensure that the plr was proceed by kueue, but not that the right VM was requested.
@filariow do we want to also compare the resource request annotation to the PLATFORM param provided to the task?

)

const (
HostConfig string = "host-config"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move to pkg/constant and use here and in 'taskrun.go'?

return nil, err
}

// ensure configuration is valid before starting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it makes sense to move it higher, and use in TR cache? (see line 90?)

@filariow filariow marked this pull request as draft February 3, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants