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

Propose preferred cluster #3105

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

RainbowMango
Copy link
Member

@RainbowMango RainbowMango commented Feb 3, 2023

What type of PR is this?
/kind api-change
/kind feature

What this PR does / why we need it:

This PR addresses the discussions on issues #780 and #2085 and part of the discussion on slack.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
This PR just focuses on API change on PropagationPolicy, the complete plan is still ongoing, the following main task would be:

Does this PR introduce a user-facing change?:

Introduced `Affinities` to both `PropagationPolicy` and `ClusterPropagationPolicy`.

@karmada-bot karmada-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Feb 3, 2023
@karmada-bot karmada-bot added kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 3, 2023
@RainbowMango
Copy link
Member Author

Any comments are welcome, just cc guys who might be interested in the feature.
@kevin-wangzefeng @Garrybest @lonelyCZ @gf457832386 @jwcesign @Poor12 @XiShanYongYe-Chang

Copy link
Member

@kevin-wangzefeng kevin-wangzefeng left a comment

Choose a reason for hiding this comment

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

Some comments, there are more design points to discuss, thus I'd like to see a proposal been submitted

pkg/apis/policy/v1alpha1/propagation_types.go Outdated Show resolved Hide resolved
// Karmada scheduler could migrate workloads to the backup clusters.
//
// +optional
OrderedClusterAffinity []OrderedClusterAffinity `json:"clusterPreferredAffinity,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
OrderedClusterAffinity []OrderedClusterAffinity `json:"clusterPreferredAffinity,omitempty"`
OrderedClusterAffinity []OrderedClusterAffinityTerm `json:"clusterPreferredAffinity,omitempty"`

Copy link
Member

Choose a reason for hiding this comment

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

Need to be plural? From the name, it's not clear that this is a slice.

Copy link
Member Author

Choose a reason for hiding this comment

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

nice catch!
According to K8S API convention, Resource collections should be all lowercase and plural, whereas kinds are CamelCase and singular., at this point, we should use a plural, it's the OrderedClusterAffinities.

@kevin-wangzefeng What's your preference?

pkg/apis/policy/v1alpha1/propagation_types.go Outdated Show resolved Hide resolved
pkg/apis/policy/v1alpha1/propagation_types.go Outdated Show resolved Hide resolved
@RainbowMango RainbowMango force-pushed the pr_cluster_priority_api branch 2 times, most recently from 774edf6 to 666a43a Compare February 4, 2023 06:54
Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
@karmada-bot karmada-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 13, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #3105 (5c30415) into master (e39feeb) will decrease coverage by 0.02%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master    #3105      +/-   ##
==========================================
- Coverage   48.50%   48.49%   -0.02%     
==========================================
  Files         201      201              
  Lines       18127    18127              
==========================================
- Hits         8793     8791       -2     
- Misses       8848     8850       +2     
  Partials      486      486              
Flag Coverage Δ
unittests 48.49% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/search/proxy/store/util.go 93.36% <0.00%> (-0.95%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@RainbowMango RainbowMango marked this pull request as ready for review February 15, 2023 12:20
@karmada-bot karmada-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 15, 2023
@RainbowMango RainbowMango added this to the v1.5 milestone Feb 15, 2023
@RainbowMango RainbowMango added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 16, 2023
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

@RainbowMango RainbowMango added the lgtm Indicates that a PR is ready to be merged. label Feb 16, 2023
@karmada-bot karmada-bot merged commit 149197c into karmada-io:master Feb 16, 2023
@RainbowMango RainbowMango deleted the pr_cluster_priority_api branch February 20, 2023 11:27
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/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants