mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 11:38:15 +00:00
e2e node: fix broken assertion
It looks like the test or the branch is never executed, because it wouldn't pass: a []v1.NodeIP is value is never the same as []string. Found by the upcoming ginkgolinter update. ERROR: test/e2e_node/pod_host_ips.go:167:45: ginkgo-linter: use Equal with different types: Comparing []k8s.io/api/core/v1.HostIP with []string; either change the expected value type if possible, or use the BeEquivalentTo() matcher, instead of Equal() (ginkgolinter) ERROR: gomega.Expect(p.Status.HostIPs).Should(gomega.Equal(nodeIPs)) ERROR: ^
This commit is contained in:
parent
d0a5cd16da
commit
6302f01121
@ -158,10 +158,10 @@ var _ = common.SIGDescribe("Dual Stack Host IP [Feature:PodHostIPs]", func() {
|
||||
framework.ExpectNoError(err)
|
||||
for _, node := range nodeList.Items {
|
||||
if node.Name == p.Spec.NodeName {
|
||||
nodeIPs := []string{}
|
||||
nodeIPs := []v1.HostIP{}
|
||||
for _, address := range node.Status.Addresses {
|
||||
if address.Type == v1.NodeInternalIP {
|
||||
nodeIPs = append(nodeIPs, address.Address)
|
||||
nodeIPs = append(nodeIPs, v1.HostIP{IP: address.Address})
|
||||
}
|
||||
}
|
||||
gomega.Expect(p.Status.HostIPs).Should(gomega.Equal(nodeIPs))
|
||||
@ -214,10 +214,10 @@ var _ = common.SIGDescribe("Dual Stack Host IP [Feature:PodHostIPs]", func() {
|
||||
framework.ExpectNoError(err)
|
||||
for _, node := range nodeList.Items {
|
||||
if node.Name == p.Spec.NodeName {
|
||||
nodeIPs := []string{}
|
||||
nodeIPs := []v1.HostIP{}
|
||||
for _, address := range node.Status.Addresses {
|
||||
if address.Type == v1.NodeInternalIP {
|
||||
nodeIPs = append(nodeIPs, address.Address)
|
||||
nodeIPs = append(nodeIPs, v1.HostIP{IP: address.Address})
|
||||
}
|
||||
}
|
||||
gomega.Expect(p.Status.HostIPs).Should(gomega.Equal(nodeIPs))
|
||||
|
Loading…
Reference in New Issue
Block a user