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

feat: strategytype should be duplicated, add default case for Replica… #5289

Conversation

vie-serendipity
Copy link
Contributor

…DivisionPreference

What type of PR is this?

/kind feature

What this PR does / why we need it:
According to this snippet of code, default ReplicaSchedulingType should be Duplicated.

func (p *Placement) ReplicaSchedulingType() ReplicaSchedulingType {
	if p.ReplicaScheduling == nil {
		return ReplicaSchedulingTypeDuplicated
	}

	return p.ReplicaScheduling.ReplicaSchedulingType
}

And in case that ReplicaSchedulingType is divided and ReplicaDivisionPreference is not defined, default ReplicaDivisionPreference should be added. I think Aggregated is more appropriate.
Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 1, 2024
@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 1, 2024
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign rainbowmango, xishanyongye-chang for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 1, 2024
…DivisionPreference

Signed-off-by: vie-serendipity <2733147505@qq.com>
@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

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

Project coverage is 28.23%. Comparing base (1432eca) to head (4ea4f6e).

Files Patch % Lines
pkg/scheduler/core/assignment.go 0.00% 2 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5289      +/-   ##
==========================================
+ Coverage   28.22%   28.23%   +0.01%     
==========================================
  Files         632      632              
  Lines       43762    43764       +2     
==========================================
+ Hits        12350    12355       +5     
+ Misses      30508    30507       -1     
+ Partials      904      902       -2     
Flag Coverage Δ
unittests 28.23% <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.

@XiShanYongYe-Chang
Copy link
Member

Hi @vie-serendipity thanks for your contribution!
/assign

@whitewindmills
Copy link
Member

And in case that ReplicaSchedulingType is divided and ReplicaDivisionPreference is not defined, default ReplicaDivisionPreference should be added. I think Aggregated is more appropriate.

now its default value is Weighted, why do you need to change its default value?

@XiShanYongYe-Chang
Copy link
Member

Hi @vie-serendipity, when .spec.placement.replicaScheduling is empty, the ReplicaSchedulingType will be regarded as Duplicated, otherwise it will be regarded as Diveded, related discussion can refer here: #3014

@vie-serendipity
Copy link
Contributor Author

@XiShanYongYe-Chang Thanks, the discussion was clear, I got it.

@vie-serendipity
Copy link
Contributor Author

@whitewindmills At first I didn't see a default weight reference, now I think weighted makes sense.

@vie-serendipity
Copy link
Contributor Author

Thanks for your time.

@XiShanYongYe-Chang
Copy link
Member

@vie-serendipity Still thank you for your enthusiasm and participation in the community. Looking forward to your continued contribution. ^-^

By the way, are you using Karmada, or are you learning Karmada?

@vie-serendipity
Copy link
Contributor Author

I'm still learning Karmada, I think it's an awesome project.

@XiShanYongYe-Chang
Copy link
Member

Thanks @vie-serendipity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants