-
Notifications
You must be signed in to change notification settings - Fork 527
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
Make GetReplicasFromRuntimeObject work for DaemonSets #782
Conversation
f94f9f3
to
5f72fbf
Compare
@@ -288,7 +288,7 @@ func GetReplicasFromRuntimeObject(obj runtime.Object) (int32, error) { | |||
} | |||
return 0, nil | |||
case *appsv1.DaemonSet: | |||
return 0, nil | |||
return int32(numNodes), nil |
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 think that's a good way of doing this. In DaemonSet you can set node-selector and then less pods can be created.
So instead of that, I think we should pass a ClientSet to this method and here list nodes with a given label-selector and return this number. I know this has a performance implication, but that isn't something that will be called all the time, and it will be more correct.
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.
Done, PTAL
c6781b0
to
5aff778
Compare
return numSchedulableNodes, nil | ||
} | ||
|
||
// Note: This function assumes each controller has field Spec.Replicas, except Job. |
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.
and deaemon set?
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.
Done.
5aff778
to
f35d333
Compare
f35d333
to
5602a6c
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mm4tt, wojtek-t 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 |
This is not an ideal solution as it ignores affinity, but it's a good start and for now should fit our needs.
Ref. #704