mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 18:02:01 +00:00
test/e2e: Fix flaking subresource test
Avoid comparing fields that might end up changing between two invocations of kubectl. Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
This commit is contained in:
parent
9c2d28f7d5
commit
87b64744dc
@ -1990,7 +1990,22 @@ metadata:
|
||||
outBuiltIn := e2ekubectl.RunKubectlOrDie("", "get", "nodes", node.Name)
|
||||
ginkgo.By(fmt.Sprintf("calling kubectl get nodes %s --subresource=status", node.Name))
|
||||
outStatusSubresource := e2ekubectl.RunKubectlOrDie("", "get", "nodes", node.Name, "--subresource=status")
|
||||
gomega.Expect(outBuiltIn).To(gomega.Equal(outStatusSubresource))
|
||||
// Avoid comparing values of fields that might end up
|
||||
// changing between the two invocations of kubectl.
|
||||
requiredOutput := [][]string{
|
||||
{"NAME"},
|
||||
{"STATUS"},
|
||||
{"ROLES"},
|
||||
{"AGE"},
|
||||
{"VERSION"},
|
||||
{node.Name}, // check for NAME
|
||||
{""}, // avoid comparing STATUS
|
||||
{""}, // avoid comparing ROLES
|
||||
{""}, // avoid comparing AGE
|
||||
{node.Status.NodeInfo.KubeletVersion}, // check for VERSION
|
||||
}
|
||||
checkOutput(outBuiltIn, requiredOutput)
|
||||
checkOutput(outStatusSubresource, requiredOutput)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user