fix(clustered): propagate pod metadata to JobSet - #8000
Open
Chiuuu0209 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Chris Chiu <69319144+Chiuuu0209@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, aligns with the stated behavior and precedence requirements, and is covered by a focused regression test.
Pull request overview
This PR fixes the clustered K8s plugin so labels/annotations resolved onto the PodTemplate are also propagated to the parent JobSet’s ObjectMeta, enabling admission controllers (e.g., Kueue) that rely on CRD-level metadata to function correctly for clustered tasks.
Changes:
- Merge resolved pod-template labels into JobSet
ObjectMeta.Labels, while ensuringflyte.org/executionretains precedence. - Merge resolved pod-template annotations into JobSet
ObjectMeta.Annotations, while ensuring Flyte-owned annotations retain precedence. - Add a regression test covering both propagation (parent + child) and precedence behavior.
File summaries
| File | Description |
|---|---|
| flyteplugins/go/tasks/plugins/k8s/clustered/build.go | Propagates resolved pod-template labels/annotations up to the parent JobSet, preserving Flyte-owned key precedence. |
| flyteplugins/go/tasks/plugins/k8s/clustered/clustered_test.go | Adds regression coverage asserting parent JobSet receives custom metadata and Flyte-owned keys override user-provided values. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking issue
Closes #7989
Why are the changes needed?
PodTemplate labels and annotations are propagated to the child pod
template but not to the parent JobSet. Controllers such as Kueue read
queue labels from the parent JobSet CRD, so clustered tasks using these
labels cannot be admitted correctly.
What changes were proposed in this pull request?
Merge the resolved PodTemplate labels and annotations into the JobSet's
ObjectMeta.
Flyte-managed metadata is applied after the PodTemplate metadata so that
the following values retain precedence:
flyte.org/executionflyte.org/task-typeflyte.org/primary-containerA regression test verifies that custom labels and annotations are
propagated to both the parent JobSet and the child pod template. It also
verifies that Flyte-managed metadata retains precedence over
user-provided values.
The regression test was confirmed to fail before the fix because the
custom metadata was absent from the parent JobSet.
How was this patch tested?
All commands passed.
make -C flyteplugins lintdid not reach the lint step because the localtooling bootstrap expected
flytestdlib/bin/pflags, which is not producedby the current
flytestdlibcompile target.Labels
fixed
Setup process
No special setup is required.
Screenshots
Not applicable.
Check all the applicable boxes