Skip to content

feat(podgrouper): preserve externally-assigned topology constraint#1771

Open
noiyemini wants to merge 3 commits into
kai-scheduler:mainfrom
noiyemini:nyemini/ignore-topology-constraint-if-already-assigned
Open

feat(podgrouper): preserve externally-assigned topology constraint#1771
noiyemini wants to merge 3 commits into
kai-scheduler:mainfrom
noiyemini:nyemini/ignore-topology-constraint-if-already-assigned

Conversation

@noiyemini

@noiyemini noiyemini commented Jun 25, 2026

Copy link
Copy Markdown

Description

Podgrouper now preserves an existing PodGroup's topology constraint when the workload does not specify one, so a topology assigned outside of KAI is not overwritten on reconcile.

When the workload carries topology annotations, those still take precedence — the externally-assigned constraint is only retained when the incoming PodGroup has an empty Spec.TopologyConstraint.Topology.

Related Issues

Fixes #

Checklist

  • Self-reviewed
  • Added/updated tests (if needed)
  • Updated documentation (if needed)

Breaking Changes

None.

Additional Notes

Added Test_ignoreFields_TopologyConstraint covering: workload without topology preserves the external constraint, workload annotations override it, both-empty stays empty, and a topology level without a topology name still preserves the existing constraint.

🤖 Generated with Claude Code

noiyemini and others added 2 commits June 25, 2026 11:26
Keep the existing PodGroup topology constraint when the workload does not
specify one, so a topology assigned by an external PodGroupAssigner is not
overwritten. Workload annotations still take precedence when present.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 656bdf8c-45ec-46fc-b647-a7e604048e63

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Total coverage: 52.2% -> 52.3% (delta 0.10%)

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/kai-scheduler/KAI-scheduler/pkg/podgrouper/podgroup 74.29% (+18.40%) 🎉

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/kai-scheduler/KAI-scheduler/pkg/podgrouper/podgroup/handler.go 61.70% (+28.37%) 47 (+2) 29 (+14) 18 (-12) 🌟

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/kai-scheduler/KAI-scheduler/pkg/podgrouper/podgroup/handler_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants