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 duplicate bind issues #832

Merged
merged 4 commits into from
Nov 24, 2021
Merged

fix duplicate bind issues #832

merged 4 commits into from
Nov 24, 2021

Conversation

bwagner5
Copy link
Contributor

1. Issue, if available:
N/A

2. Description of changes:

  • Fix pod binding issue where the provisioner would try to bind the pod twice resulting in bind failure logging.
  • Renamed helper func IsUnschedulable to isSchedulable
    • IsUnschedulable doesn't make sense to describe what the function does. Although the func does do one check to determine if kube-scheduler is failed to schedule the pod, it also does a number of other checks such as if the pod is not already scheduled to a node. I think it makes more sense to name the func in the context of Karpenter's view of schedulable, hence, isSchedulable.

3. Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: link to issue
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@netlify
Copy link

netlify bot commented Nov 21, 2021

✔️ Deploy Preview for karpenter-docs-prod canceled.

🔨 Explore the source changes: 0c9c03e

🔍 Inspect the deploy log: https://app.netlify.com/sites/karpenter-docs-prod/deploys/619dbe6d295ab20008ad767e

@bwagner5 bwagner5 changed the title fix duplicate bind issues [WIP] fix duplicate bind issues Nov 22, 2021
@bwagner5
Copy link
Contributor Author

Not ready yet, need to look into test failures.

for _, pod := range pods {
candidate := pod
if err := p.kubeClient.Get(ctx, types.NamespacedName{Namespace: pod.Namespace, Name: pod.Name}, candidate); err != nil {
logging.FromContext(ctx).Errorf("Checking if pod \"%s\" is provisionable", pod)
Copy link
Contributor

Choose a reason for hiding this comment

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

This error log line seems a bit odd to me. Also, what if the pod is deleted at this point? Perhaps we should continue if errors.IsNotFound, but log an error otherwise? "Unexpected error filtering provisionable pods, %s"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tbh I think a lot of our error logging is really weird like this and doesn't read well in the actual log. I've tried to keep with our convention for the most part, but I definitely like explicitly saying "Unexpected error" rather than relying on the log level to convey it's an error. Maybe we should clean up the other error logging.

Copy link
Contributor

Choose a reason for hiding this comment

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

I love this comment! No need to say failed if it's an error!

ellistarn
ellistarn previously approved these changes Nov 24, 2021
@bwagner5 bwagner5 changed the title [WIP] fix duplicate bind issues fix duplicate bind issues Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants