-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Remove unnecessary error catch in scheduling failure #121981
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @utam0k. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
…missing Node Signed-off-by: utam0k <k0ma@utam0k.jp>
pkg/scheduler/schedule_one.go
Outdated
@@ -987,7 +987,7 @@ func (sched *Scheduler) handleSchedulingFailure(ctx context.Context, fwk framewo | |||
logger.V(2).Info("Unable to schedule pod; no fit; waiting", "pod", klog.KObj(pod), "err", errMsg) | |||
} else if apierrors.IsNotFound(err) { | |||
logger.V(2).Info("Unable to schedule pod, possibly due to node not found; waiting", "pod", klog.KObj(pod), "err", errMsg) | |||
if errStatus, ok := err.(apierrors.APIStatus); ok && errStatus.Status().Details.Kind == "node" { | |||
if errStatus, ok := err.(apierrors.APIStatus); ok && (errStatus.Status().Details.Kind == "nodes" || errStatus.Status().Details.Kind == "node") { // Ususally `node` is used as the Kind, but `nodes` is also possible. |
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.
Looks really weird, please explain when which one is used. I'd like to seek a possible solution where only one kind is used here.
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.
At least, apierrors
uses resource name(nodes
) as a kind in StatusError
.
kubernetes/staging/src/k8s.io/apimachinery/pkg/api/errors/errors.go
Lines 144 to 156 in d61cbac
func NewNotFound(qualifiedResource schema.GroupResource, name string) *StatusError { | |
return &StatusError{metav1.Status{ | |
Status: metav1.StatusFailure, | |
Code: http.StatusNotFound, | |
Reason: metav1.StatusReasonNotFound, | |
Details: &metav1.StatusDetails{ | |
Group: qualifiedResource.Group, | |
Kind: qualifiedResource.Resource, | |
Name: name, | |
}, | |
Message: fmt.Sprintf("%s %q not found", qualifiedResource.String(), name), | |
}} | |
} |
I honestly don't know if there is room to plant StatusError from elsewhere. node
is nuanced enough that there may possibly be errors transmitted from user plug-ins, etc., which may not be needed.
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.
I don't like "keep it because someone may use it" in general. We want to catch non-found errors from kube-apiserver, so if kube-apiserver emits errors with "nodes", then supporting "nodes" only should be enough.
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.
👌
d3def07
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.
/ok-to-test
Signed-off-by: utam0k <k0ma@utam0k.jp>
Signed-off-by: utam0k <k0ma@utam0k.jp>
Failures look legit |
Ops.. I'll check them |
Signed-off-by: utam0k <k0ma@utam0k.jp>
/retest-required |
/remove-kind bug |
/lgtm |
LGTM label has been added. Git tree hash: 79ec6a4cb543557a3f717a5978b2cb428be4a312
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, utam0k 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 |
/label tide/merge-method-squash |
* Deleted from the cache in the handling of scheduling failures due to missing Node Signed-off-by: utam0k <k0ma@utam0k.jp> * Support only `nodes` * Remove unnecessary error catch Signed-off-by: utam0k <k0ma@utam0k.jp> * Fix a build error Signed-off-by: utam0k <k0ma@utam0k.jp> * Fix a build error Signed-off-by: utam0k <k0ma@utam0k.jp> --------- Signed-off-by: utam0k <k0ma@utam0k.jp>
* Deleted from the cache in the handling of scheduling failures due to missing Node Signed-off-by: utam0k <k0ma@utam0k.jp> * Support only `nodes` * Remove unnecessary error catch Signed-off-by: utam0k <k0ma@utam0k.jp> * Fix a build error Signed-off-by: utam0k <k0ma@utam0k.jp> * Fix a build error Signed-off-by: utam0k <k0ma@utam0k.jp> --------- Signed-off-by: utam0k <k0ma@utam0k.jp>
* Deleted from the cache in the handling of scheduling failures due to missing Node Signed-off-by: utam0k <k0ma@utam0k.jp> * Support only `nodes` * Remove unnecessary error catch Signed-off-by: utam0k <k0ma@utam0k.jp> * Fix a build error Signed-off-by: utam0k <k0ma@utam0k.jp> * Fix a build error Signed-off-by: utam0k <k0ma@utam0k.jp> --------- Signed-off-by: utam0k <k0ma@utam0k.jp>
* Deleted from the cache in the handling of scheduling failures due to missing Node Signed-off-by: utam0k <k0ma@utam0k.jp> * Support only `nodes` * Remove unnecessary error catch Signed-off-by: utam0k <k0ma@utam0k.jp> * Fix a build error Signed-off-by: utam0k <k0ma@utam0k.jp> * Fix a build error Signed-off-by: utam0k <k0ma@utam0k.jp> --------- Signed-off-by: utam0k <k0ma@utam0k.jp>
What type of PR is this?
/kind bug
What this PR does / why we need it:
With apierrors, kind is plural. It is likely that these are not working well because they have not been made appropriate.Remove unnecessary error catch in scheduling failure.
Which issue(s) this PR fixes:
Fixes #121980
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: