mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-29 21:29:24 +00:00
Replace ExpectNoError(fmt.Errorf(..)) with funcs
There were framework.ExpectNoError(fmt.Errorf(..)) calls which just raise an exception without actual value checks, they just raised the specified error messages. These usages of framework.ExpectNoError() seemed a little tricky, so this replaces them with corresponding check functions for the readability.
This commit is contained in:
@@ -182,9 +182,7 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
|
||||
}
|
||||
return true, nil
|
||||
})
|
||||
if pollErr != nil {
|
||||
framework.ExpectNoError(fmt.Errorf("timed out waiting for ingress %s to get %s annotation", name, instanceGroupAnnotation))
|
||||
}
|
||||
framework.ExpectNoError(pollErr, "timed out waiting for ingress %s to get %s annotation", name, instanceGroupAnnotation)
|
||||
|
||||
// Verify that the ingress does not get other annotations like url-map, target-proxy, backends, etc.
|
||||
// Note: All resources except the firewall rule have an annotation.
|
||||
|
||||
@@ -141,9 +141,8 @@ var _ = SIGDescribe("NoSNAT [Feature:NoSNAT] [Slow]", func() {
|
||||
ginkgo.By("creating a test pod on each Node")
|
||||
nodes, err := nc.List(context.TODO(), metav1.ListOptions{})
|
||||
framework.ExpectNoError(err)
|
||||
if len(nodes.Items) == 0 {
|
||||
framework.ExpectNoError(fmt.Errorf("no Nodes in the cluster"))
|
||||
}
|
||||
framework.ExpectNotEqual(len(nodes.Items), 0, "no Nodes in the cluster")
|
||||
|
||||
for _, node := range nodes.Items {
|
||||
// find the Node's internal ip address to feed to the Pod
|
||||
inIP, err := getIP(v1.NodeInternalIP, &node)
|
||||
|
||||
Reference in New Issue
Block a user