Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the bug in interpreting the replicas of Job #5095

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

whitewindmills
Copy link
Member

@whitewindmills whitewindmills commented Jun 24, 2024

What type of PR is this?
/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-controller-manager`: Fixed the issue that the default resource interpreter doesn't accurately interpret the numbers of replicas.

@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 24, 2024
@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 24, 2024
Signed-off-by: whitewindmills <jayfantasyhjh@gmail.com>
@whitewindmills
Copy link
Member Author

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 28.22%. Comparing base (1255a08) to head (bf9eaf0).

Files Patch % Lines
pkg/resourceinterpreter/default/native/replica.go 0.00% 3 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5095   +/-   ##
=======================================
  Coverage   28.22%   28.22%           
=======================================
  Files         632      632           
  Lines       43551    43554    +3     
=======================================
+ Hits        12293    12294    +1     
- Misses      30362    30364    +2     
  Partials      896      896           
Flag Coverage Δ
unittests 28.22% <0.00%> (+<0.01%) ⬆️

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.

@chaunceyjiang
Copy link
Member

/assign

// For fixed completion count Jobs, the actual number of pods running in parallel will not exceed the number of remaining completions.
// Higher values of .spec.parallelism are effectively ignored.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/job/
completions := ptr.Deref[int32](job.Spec.Completions, replica)
Copy link
Member

Choose a reason for hiding this comment

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

Indeed. In my local test, when parallelism > completions, only completions number of jobs will be generated.

Copy link
Member

Choose a reason for hiding this comment

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

image image

Copy link
Member

Choose a reason for hiding this comment

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

So, we are trying to address the accuracy issue. Right?

Generally looks good to me, just a question need to confirm.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

Copy link
Member

@chaunceyjiang chaunceyjiang left a comment

Choose a reason for hiding this comment

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

/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 25, 2024
Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

Thanks a lot
/lgtm

@whitewindmills
Copy link
Member Author

ping @RainbowMango

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/approve

I updated the release notes by the way.

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 26, 2024
@RainbowMango RainbowMango added this to the v1.11 milestone Jun 26, 2024
@karmada-bot karmada-bot merged commit 4706dd8 into karmada-io:master Jun 26, 2024
12 checks passed
@whitewindmills whitewindmills deleted the jobs-replicas branch June 26, 2024 09:50
karmada-bot added a commit that referenced this pull request Jun 27, 2024
…-#5095-upstream-release-1.10

Automated cherry pick of #5095: Fix the bug in interpreting the replicas of Job
karmada-bot added a commit that referenced this pull request Jun 27, 2024
…-#5095-upstream-release-1.8

Automated cherry pick of #5095: Fix the bug in interpreting the replicas of Job
karmada-bot added a commit that referenced this pull request Jun 27, 2024
…-#5095-upstream-release-1.9

Automated cherry pick of #5095: Fix the bug in interpreting the replicas of Job
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants