Skip to content

Commit

Permalink
Merge pull request #1328 from marquiz/devel/e2e-one-node
Browse files Browse the repository at this point in the history
e2e/test: make the nfd-gc test pass on one-node cluster
  • Loading branch information
k8s-ci-robot authored Sep 5, 2023
2 parents 16b96ff + f8162a0 commit 0fa57b6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/e2e/nfd_gc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0fa57b6

Please sign in to comment.