-
Notifications
You must be signed in to change notification settings - Fork 917
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
skip the filter if the cluster is already in the list of scheduling result even if the API is missed #5216
Conversation
19f0f32
to
5a4f42b
Compare
/retest |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5216 +/- ##
==========================================
- Coverage 34.14% 34.14% -0.01%
==========================================
Files 643 643
Lines 44522 44527 +5
==========================================
+ Hits 15204 15205 +1
- Misses 28162 28166 +4
Partials 1156 1156
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks for your feedback @yanfeng1992
When will that happen? |
I guess it's when the status of AA is false? |
When the AA status is false and the cluster status is healthy |
Thanks @chaunceyjiang @yanfeng1992 , I get it. |
@@ -55,8 +55,12 @@ func (p *APIEnablement) Filter( | |||
cluster *clusterv1alpha1.Cluster, | |||
) *framework.Result { | |||
if !helper.IsAPIEnabled(cluster.Status.APIEnablements, bindingSpec.Resource.APIVersion, bindingSpec.Resource.Kind) { | |||
klog.V(2).Infof("Cluster(%s) not fit as missing API(%s, kind=%s)", cluster.Name, bindingSpec.Resource.APIVersion, bindingSpec.Resource.Kind) | |||
return framework.NewResult(framework.Unschedulable, "cluster(s) did not have the API resource") | |||
if !bindingSpec.TargetContains(cluster.Name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The core meaning of your PR is: If the binding has already been scheduled to a certain cluster, then we should ignore this apienablement
plugin, right?
I have a question: If the AA service is no longer healthy, can it still create corresponding resources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we determine whether the cluster status needs to be updated based on the returned error?
karmada/pkg/controllers/status/cluster_status_controller.go
Lines 233 to 239 in a87ec2a
apiEnables, err := getAPIEnablements(clusterClient) | |
if len(apiEnables) == 0 { | |
klog.Errorf("Failed to get any APIs installed in Cluster %s. Error: %v.", cluster.GetName(), err) | |
} else if err != nil { | |
klog.Warningf("Maybe get partial(%d) APIs installed in Cluster %s. Error: %v.", len(apiEnables), cluster.GetName(), err) | |
} | |
currentClusterStatus.APIEnablements = apiEnables |
Only when the err description indicates that some APIs fail to be installed, the returned apiEnables will be updated to the cluster status.
/assign @XiShanYongYe-Chang |
5a4f42b
to
ecc4dc7
Compare
@RainbowMango @XiShanYongYe-Chang |
Of course, let me take a review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/assign
I want to take a look.
pkg/scheduler/framework/plugins/apienablement/api_enablement.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/apienablement/api_enablement.go
Outdated
Show resolved
Hide resolved
60be972
to
aac64b1
Compare
It seems not the one I suggested. |
…omplete to prevent accidental removal. Signed-off-by: huangyanfeng <[email protected]>
aac64b1
to
4c416ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@yanfeng1992 Have you tested it?
step1. stop karmada-controller-manager and patch cluster step2: edit crb add label for test log:
|
/approve |
[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 |
Signed-off-by: huangyanfeng [email protected]
What type of PR is this?
/kind bug
What this PR does / why we need it:
Because when obtaining APIEnablements, it may be empty or partial.
This will cause the scheduler to delete the scheduling results, resulting in incorrect deletion
So if the cluster is already in the list of scheduling results, even if the API is not hit, skip the filter
karmada/pkg/controllers/status/cluster_status_controller.go
Lines 233 to 239 in a87ec2a
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: