diff --git a/test/e2e/kubectl/kubectl.go b/test/e2e/kubectl/kubectl.go index e8f2143c2e8..a15ccc93148 100644 --- a/test/e2e/kubectl/kubectl.go +++ b/test/e2e/kubectl/kubectl.go @@ -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) }) }) })