@@ -19,7 +19,7 @@ package v1beta1
1919import (
2020 "testing"
2121
22- . "github.com/onsi/gomega"
22+ . "github.com/onsi/gomega" //revive:disable:dot-imports
2323 apierrors "k8s.io/apimachinery/pkg/api/errors"
2424 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2525 "k8s.io/apimachinery/pkg/util/validation/field"
@@ -1554,10 +1554,9 @@ func TestNetConfigValidation(t *testing.T) {
15541554 basePath := field .NewPath ("spec" )
15551555
15561556 if tt .expectErr {
1557- g .Expect (len ( valiateNetworks (tt .c .Spec .Networks , basePath ))). Should ( BeNumerically ( ">" , 0 ))
1557+ g .Expect (valiateNetworks (tt .c .Spec .Networks , basePath )). ShouldNot ( BeEmpty ( ))
15581558 } else {
1559- g .Expect (len (valiateNetworks (tt .c .Spec .Networks , basePath ))).Should (BeNumerically ("==" , 0 ))
1560-
1559+ g .Expect (valiateNetworks (tt .c .Spec .Networks , basePath )).Should (BeEmpty ())
15611560 }
15621561 })
15631562 }
@@ -1781,7 +1780,7 @@ func TestNetConfigUpdateValidation(t *testing.T) {
17811780 g := NewWithT (t )
17821781 basePath := field .NewPath ("spec" )
17831782
1784- new := & NetConfig {
1783+ newCfg := & NetConfig {
17851784 ObjectMeta : metav1.ObjectMeta {
17861785 Namespace : "foo" ,
17871786 },
@@ -1792,12 +1791,12 @@ func TestNetConfigUpdateValidation(t *testing.T) {
17921791
17931792 allErrs := valiateNetworks (tt .newSpec .Networks , basePath )
17941793 if len (allErrs ) > 0 {
1795- err = apierrors .NewInvalid (GroupVersion .WithKind ("NetConfig" ).GroupKind (), new .Name , allErrs )
1794+ err = apierrors .NewInvalid (GroupVersion .WithKind ("NetConfig" ).GroupKind (), newCfg .Name , allErrs )
17961795 }
17971796
17981797 allErrs = valiateNetworksChanged (tt .newSpec .Networks , tt .oldSpec .Networks , basePath )
17991798 if len (allErrs ) > 0 {
1800- err = apierrors .NewInvalid (GroupVersion .WithKind ("NetConfig" ).GroupKind (), new .Name , allErrs )
1799+ err = apierrors .NewInvalid (GroupVersion .WithKind ("NetConfig" ).GroupKind (), newCfg .Name , allErrs )
18011800 }
18021801
18031802 if tt .expectErr {
0 commit comments