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

Stop considering nodes without kubevirt.io/schedulable label when finding lowest TSC frequency on the cluster #10182

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 1 addition & 13 deletions pkg/virt-controller/watch/topology/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,7 @@ func IsSchedulable(node *v1.Node) bool {
return false
}

if node.Labels[virtv1.NodeSchedulable] != "true" || node.Spec.Unschedulable {
return false
}

if node.Spec.Taints != nil {
for _, taint := range node.Spec.Taints {
if taint.Effect == v1.TaintEffectNoSchedule {
return false
}
}
}

return true
return node.Labels[virtv1.NodeSchedulable] == "true"
Copy link
Member

Choose a reason for hiding this comment

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

I just want to point out that this will be changed to false if e.g. the virt-handler daemonset needs to pull an image for a long time during update, or if there are other issues on virt-handler. As a consequence we may even exclude this node while there are actually VMs running on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you @rmohr, that's a good point!
Added, PTAL.

}

func HasInvTSCFrequency(node *v1.Node) bool {
Expand Down
34 changes: 0 additions & 34 deletions pkg/virt-controller/watch/topology/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,40 +30,6 @@ var _ = Describe("Filter", func() {
))
})

It("should filter out nodes with a noschedule taint", func() {
nodeWithUnschedulableTaint := node("node0", true)
nodeWithUnschedulableTaint.Spec.Taints = []v1.Taint{{Key: "noschedule", Effect: v1.TaintEffectNoSchedule}}

nodes := topology.NodesToObjects(
nodeWithUnschedulableTaint,
node("node1", false),
node("node2", true),
nil,
)
Expect(topology.FilterNodesFromCache(nodes,
topology.IsSchedulable,
)).To(ConsistOf(
nodes[2],
))
})

It("should filter out nodes with spec.unschedulable == true", func() {
nodeWithUnschedulableField := node("node0", true)
nodeWithUnschedulableField.Spec.Unschedulable = true

nodes := topology.NodesToObjects(
nodeWithUnschedulableField,
node("node1", false),
node("node2", true),
nil,
)
Expect(topology.FilterNodesFromCache(nodes,
topology.IsSchedulable,
)).To(ConsistOf(
nodes[2],
))
})

It("should inverse the search result", func() {
nodes := topology.NodesToObjects(
node("node0", true),
Expand Down