Merge pull request #116619 from MadhavJivrajani/fix-subresource-e2e-flake

test/e2e: Fix flaking subresource test
This commit is contained in:
Kubernetes Prow Robot 2023-03-14 17:45:02 -07:00 committed by GitHub
commit 2c8dffdd5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2052,7 +2052,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)
})
})
})