1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

e2e/test: make the nfd-gc test pass on one-node cluster

Also remove some leftover debug print.
This commit is contained in:
Markus Lehtonen 2023-09-05 14:16:50 +03:00
parent 16b96ff896
commit f8162a0106

View file

@ -93,7 +93,6 @@ var _ = SIGDescribe("NFD GC", func() {
if err := utils.CreateNodeResourceTopology(ctx, topologyClient, name); err != nil {
return err
}
framework.Logf("CREATED CRS FOR node %q", name)
}
return nil
}
@ -121,7 +120,11 @@ var _ = SIGDescribe("NFD GC", func() {
It("it should delete stale objects at startup", func(ctx context.Context) {
nodes, err := f.ClientSet.CoreV1().Nodes().List(ctx, metav1.ListOptions{})
Expect(err).NotTo(HaveOccurred())
targetNodeNames := []string{nodes.Items[0].GetName(), nodes.Items[len(nodes.Items)-1].GetName()}
targetNodeNames := []string{nodes.Items[0].GetName()}
if len(nodes.Items) > 1 {
// Add another node if we're in larger than one-node cluster
targetNodeNames = append(targetNodeNames, nodes.Items[len(nodes.Items)-1].GetName())
}
staleNodeNames := []string{"non-existent-node-1", "non-existent-node-2"}
// Create NodeFeature and NodeResourceTopology objects
@ -153,7 +156,11 @@ var _ = SIGDescribe("NFD GC", func() {
It("it should remove stale objects", func(ctx context.Context) {
nodes, err := f.ClientSet.CoreV1().Nodes().List(ctx, metav1.ListOptions{})
Expect(err).NotTo(HaveOccurred())
targetNodeNames := []string{nodes.Items[0].GetName(), nodes.Items[len(nodes.Items)-1].GetName()}
targetNodeNames := []string{nodes.Items[0].GetName()}
if len(nodes.Items) > 1 {
// Add another node if we're in larger than one-node cluster
targetNodeNames = append(targetNodeNames, nodes.Items[len(nodes.Items)-1].GetName())
}
staleNodeNames := []string{"non-existent-node-2.1", "non-existent-node-2.2"}
// Deploy nfd-gc