From 6fcd030877e888142843a947baf05f365d9b7074 Mon Sep 17 00:00:00 2001 From: SataQiu <1527062125@qq.com> Date: Tue, 3 Dec 2019 23:36:09 +0800 Subject: [PATCH] fix staticcheck failures of test/e2e/upgrade --- hack/.staticcheck_failures | 2 -- test/e2e/upgrades/services.go | 4 ++-- test/e2e/upgrades/storage/volume_mode.go | 7 +++---- test/e2e/upgrades/sysctl.go | 4 ++-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/hack/.staticcheck_failures b/hack/.staticcheck_failures index a90443e253d..81c2ed44e2c 100644 --- a/hack/.staticcheck_failures +++ b/hack/.staticcheck_failures @@ -77,8 +77,6 @@ test/e2e/storage/drivers test/e2e/storage/testsuites test/e2e/storage/utils test/e2e/storage/vsphere -test/e2e/upgrades -test/e2e/upgrades/storage test/images/agnhost/dns test/images/agnhost/inclusterclient test/images/agnhost/net/nat diff --git a/test/e2e/upgrades/services.go b/test/e2e/upgrades/services.go index d42f0eb88c2..95c3f77f30d 100644 --- a/test/e2e/upgrades/services.go +++ b/test/e2e/upgrades/services.go @@ -49,11 +49,11 @@ func (t *ServiceUpgradeTest) Setup(f *framework.Framework) { cs := f.ClientSet ginkgo.By("creating a TCP service " + serviceName + " with type=LoadBalancer in namespace " + ns.Name) - tcpService, err := jig.CreateTCPService(func(s *v1.Service) { + _, err := jig.CreateTCPService(func(s *v1.Service) { s.Spec.Type = v1.ServiceTypeLoadBalancer }) framework.ExpectNoError(err) - tcpService, err = jig.WaitForLoadBalancer(e2eservice.GetServiceLoadBalancerCreationTimeout(cs)) + tcpService, err := jig.WaitForLoadBalancer(e2eservice.GetServiceLoadBalancerCreationTimeout(cs)) framework.ExpectNoError(err) // Get info to hit it with diff --git a/test/e2e/upgrades/storage/volume_mode.go b/test/e2e/upgrades/storage/volume_mode.go index 61ead730248..cb082888d6a 100644 --- a/test/e2e/upgrades/storage/volume_mode.go +++ b/test/e2e/upgrades/storage/volume_mode.go @@ -38,10 +38,9 @@ const devicePath = "/mnt/volume1" // formatted and mounted like a nil/Filesystem PV after a downgrade to a version // where the BlockVolume feature is disabled type VolumeModeDowngradeTest struct { - pvSource *v1.PersistentVolumeSource - pv *v1.PersistentVolume - pvc *v1.PersistentVolumeClaim - pod *v1.Pod + pv *v1.PersistentVolume + pvc *v1.PersistentVolumeClaim + pod *v1.Pod } // Name returns the tracking name of the test. diff --git a/test/e2e/upgrades/sysctl.go b/test/e2e/upgrades/sysctl.go index 290b3f8c5f1..27dc034a2e5 100644 --- a/test/e2e/upgrades/sysctl.go +++ b/test/e2e/upgrades/sysctl.go @@ -80,8 +80,8 @@ func (t *SysctlUpgradeTest) verifySafeSysctlWork(f *framework.Framework) *v1.Pod ginkgo.By("Creating a pod with safe sysctls") safeSysctl := "net.ipv4.ip_local_port_range" safeSysctlValue := "1024 1042" - validPod := sysctlTestPod("valid-sysctls", map[string]string{safeSysctl: safeSysctlValue}) - validPod = f.PodClient().Create(t.validPod) + sysctlTestPod("valid-sysctls", map[string]string{safeSysctl: safeSysctlValue}) + validPod := f.PodClient().Create(t.validPod) ginkgo.By("Making sure the valid pod launches") ev, err := f.PodClient().WaitForErrorEventOrSuccess(t.validPod)