Skip to content

Conversation

@ajanikow
Copy link
Collaborator

No description provided.

Copilot finished reviewing on behalf of ajanikow November 26, 2025 10:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in container resource management where downscaling of resources was not possible. Previously, the code used UpscaleContainerResourceList which only allowed increasing resource values, preventing legitimate downscaling operations. The fix replaces this with MergeContainerResource which properly handles both upscaling and downscaling scenarios.

  • Replaced UpscaleContainerResourceList with MergeContainerResource in the Apply method to enable bidirectional resource adjustments
  • Added a "Downscale" test case to verify that resources can be properly reduced from 8Mi to 1Mi

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/apis/scheduler/v1beta1/container/resources/resources.go Updated Apply method to use MergeContainerResource instead of UpscaleContainerResourceList, enabling proper resource downscaling
pkg/apis/scheduler/v1beta1/container/resources/resources_test.go Added Downscale test case to verify that container resources can be reduced from higher to lower values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ajanikow ajanikow merged commit 89b3311 into master Nov 26, 2025
3 checks passed
@ajanikow ajanikow deleted the bugfix/platform/fix_resource_adjustment branch November 26, 2025 11:36
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