Skip to content

Commit 4746f11

Browse files
committed
lint error fix
1 parent 34dd074 commit 4746f11

File tree

5 files changed

+25
-33
lines changed

5 files changed

+25
-33
lines changed

tests/e2e/gc_block_resize_retain_policy.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ var _ = ginkgo.Describe("[csi-guest] Volume Expansion Tests with reclaimation po
126126

127127
// Replace second element with pod.Name.
128128
if windowsEnv {
129-
cmd = []string{"exec", "", "--namespace=" + namespace, "--", "powershell.exe", "-Command", "cat", "/mnt/volume1/fstype.txt"}
129+
cmd = []string{"exec", "", "--namespace=" + namespace, "--", "powershell.exe", "-Command", "cat",
130+
"/mnt/volume1/fstype.txt"}
130131
} else {
131132
cmd = []string{"exec", "", "--namespace=" + namespace, "--", "/bin/sh", "-c", "df -Tkm | grep /mnt/volume1"}
132133
}
@@ -413,7 +414,7 @@ var _ = ginkgo.Describe("[csi-guest] Volume Expansion Tests with reclaimation po
413414
// 17. delete GC2.
414415
// Steps 6 and 17 need to run manually before and after this suite.
415416
ginkgo.It("PV with reclaim policy retain can be resized when used in a fresh GC", ginkgo.Label(p0,
416-
block, tkg, windows, multiGc, vc70), func() {
417+
block, tkg, vc70), func() {
417418
ctx, cancel := context.WithCancel(context.Background())
418419
defer cancel()
419420
newGcKubconfigPath := os.Getenv("NEW_GUEST_CLUSTER_KUBE_CONFIG")
@@ -587,7 +588,7 @@ var _ = ginkgo.Describe("[csi-guest] Volume Expansion Tests with reclaimation po
587588
"exec",
588589
pod.Name,
589590
"--namespace=" + namespaceNewGC,
590-
"powershell.exe",
591+
"powershell.exe -Command",
591592
"cat",
592593
"/mnt/volume1/fstype.txt",
593594
}

tests/e2e/gc_block_volume_expansion.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,14 +1537,7 @@ var _ = ginkgo.Describe("[csi-guest] Volume Expansion Test", func() {
15371537
defer func() {
15381538
// Delete POD.
15391539
ginkgo.By(fmt.Sprintf("Deleting the pod %s in namespace %s", pod.Name, namespace))
1540-
err := fpod.DeletePodWithWait(ctx, client, pod)
1541-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
1542-
isDiskDetached, err := e2eVSphere.waitForVolumeDetachedFromNode(client,
1543-
pv.Spec.CSI.VolumeHandle, pod.Spec.NodeName)
1544-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
1545-
gomega.Expect(isDiskDetached).To(gomega.BeTrue(),
1546-
fmt.Sprintf("Volume %q is not detached from the node %q", pv.Spec.CSI.VolumeHandle, pod.Spec.NodeName))
1547-
1540+
deletePodAndWaitForVolsToDetach(ctx, client, pod)
15481541
}()
15491542

15501543
ginkgo.By(fmt.Sprintf("Verify volume: %s is attached to the node: %s",

tests/e2e/k8testutil/util.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,8 +1146,8 @@ func BringDownCsiController(Client clientset.Interface, namespace ...string) {
11461146

11471147
// bringDownTKGController helps to bring the TKG control manager pod down.
11481148
// Its taks svc client as input.
1149-
func BringDownTKGController(Client clientset.Interface) {
1150-
UpdateDeploymentReplica(Client, 0, constants.VsphereControllerManager, constants.VsphereTKGSystemNamespace)
1149+
func BringDownTKGController(Client clientset.Interface, vsphereTKGSystemNamespace string) {
1150+
UpdateDeploymentReplica(Client, 0, constants.VsphereControllerManager, vsphereTKGSystemNamespace)
11511151
ginkgo.By("TKGControllManager replica is set to 0")
11521152
}
11531153

@@ -1168,9 +1168,9 @@ func BringUpCsiController(Client clientset.Interface, csiReplicaCount int32, nam
11681168

11691169
// bringUpTKGController helps to bring the TKG control manager pod up.
11701170
// Its taks svc client as input.
1171-
func BringUpTKGController(Client clientset.Interface, tkgReplica int32) {
1171+
func BringUpTKGController(Client clientset.Interface, tkgReplica int32, vsphereTKGSystemNamespace string) {
11721172
err := UpdateDeploymentReplicawithWait(Client,
1173-
tkgReplica, constants.VsphereControllerManager, constants.VsphereTKGSystemNamespace)
1173+
tkgReplica, constants.VsphereControllerManager, vsphereTKGSystemNamespace)
11741174
gomega.Expect(err).NotTo(gomega.HaveOccurred())
11751175
ginkgo.By("TKGControllManager is up")
11761176
}
@@ -7148,7 +7148,7 @@ func ExecCommandOnGcWorker(sshClientConfig *ssh.ClientConfig,
71487148
}
71497149

71507150
cmdToGetContainerInfo := fmt.Sprintf("ssh -o StrictHostKeyChecking=no -i key %s@%s "+
7151-
"'%s' | grep -v 'Warning'", constants.GcNodeUser, gcWorkerIp, cmd)
7151+
"'%s' 2> /dev/null", constants.GcNodeUser, gcWorkerIp, cmd)
71527152
framework.Logf("Invoking command '%v' on host %v", cmdToGetContainerInfo,
71537153
svcMasterIP)
71547154
cmdResult, err = SshExec(sshClientConfig, vs, svcMasterIP,

tests/e2e/util.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,8 +1066,7 @@ func bringDownCsiController(Client clientset.Interface, namespace ...string) {
10661066

10671067
// bringDownTKGController helps to bring the TKG control manager pod down.
10681068
// Its taks svc client as input.
1069-
func bringDownTKGController(Client clientset.Interface) {
1070-
vsphereTKGSystemNamespace := GetAndExpectStringEnvVar(envVsphereTKGSystemNamespace)
1069+
func bringDownTKGController(Client clientset.Interface, vsphereTKGSystemNamespace string) {
10711070
updateDeploymentReplica(Client, 0, vsphereControllerManager, vsphereTKGSystemNamespace)
10721071
ginkgo.By("TKGControllManager replica is set to 0")
10731072
}
@@ -1089,8 +1088,7 @@ func bringUpCsiController(Client clientset.Interface, csiReplicaCount int32, nam
10891088

10901089
// bringUpTKGController helps to bring the TKG control manager pod up.
10911090
// Its taks svc client as input.
1092-
func bringUpTKGController(Client clientset.Interface, tkgReplica int32) {
1093-
vsphereTKGSystemNamespace := GetAndExpectStringEnvVar(envVsphereTKGSystemNamespace)
1091+
func bringUpTKGController(Client clientset.Interface, tkgReplica int32, vsphereTKGSystemNamespace string) {
10941092
err := updateDeploymentReplicawithWait(Client, tkgReplica, vsphereControllerManager, vsphereTKGSystemNamespace)
10951093
gomega.Expect(err).NotTo(gomega.HaveOccurred())
10961094
ginkgo.By("TKGControllManager is up")
@@ -7600,7 +7598,7 @@ func execCommandOnGcWorker(sshClientConfig *ssh.ClientConfig, svcMasterIP string
76007598
}
76017599

76027600
cmdToGetContainerInfo := fmt.Sprintf("ssh -o StrictHostKeyChecking=no -i key %s@%s "+
7603-
"'%s' | grep -v 'Warning'", gcNodeUser, gcWorkerIp, cmd)
7601+
"'%s' 2> /dev/null", gcNodeUser, gcWorkerIp, cmd)
76047602
framework.Logf("Invoking command '%v' on host %v", cmdToGetContainerInfo,
76057603
svcMasterIP)
76067604
cmdResult, err = sshExec(sshClientConfig, svcMasterIP,

tests/e2e/volume_health_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,14 +1291,14 @@ var _ = ginkgo.Describe("Volume health check", func() {
12911291
gomega.Expect(err).NotTo(gomega.HaveOccurred())
12921292
csiReplicaCount := *deployment.Spec.Replicas
12931293

1294-
bringDownTKGController(svClient)
1295-
bringDownCsiController(gcClient)
1294+
bringDownTKGController(svClient, vsphereTKGSystemNamespace)
1295+
bringDownCsiController(gcClient, vsphereTKGSystemNamespace)
12961296
isControllerUP = false
12971297

12981298
defer func() {
12991299
if !isControllerUP {
1300-
bringUpTKGController(svClient, tkgReplicaCount)
1301-
bringUpCsiController(gcClient, csiReplicaCount)
1300+
bringUpTKGController(svClient, tkgReplicaCount, vsphereTKGSystemNamespace)
1301+
bringUpCsiController(gcClient, csiReplicaCount, vsphereTKGSystemNamespace)
13021302
}
13031303
}()
13041304

@@ -1315,8 +1315,8 @@ var _ = ginkgo.Describe("Volume health check", func() {
13151315
gomega.Expect(svPVC.Annotations[volumeHealthAnnotation]).Should(gomega.BeEquivalentTo(healthStatusAccessible))
13161316

13171317
ginkgo.By("Bring up csi-controller pod in GC")
1318-
bringUpTKGController(svClient, tkgReplicaCount)
1319-
bringUpCsiController(gcClient, csiReplicaCount)
1318+
bringUpTKGController(svClient, tkgReplicaCount, vsphereTKGSystemNamespace)
1319+
bringUpCsiController(gcClient, csiReplicaCount, vsphereTKGSystemNamespace)
13201320
isControllerUP = true
13211321

13221322
ginkgo.By("Verify health status of GC PVC after GC csi is up")
@@ -2141,8 +2141,8 @@ var _ = ginkgo.Describe("Volume health check", func() {
21412141
err := waitForHostToBeUp(hostIP)
21422142
gomega.Expect(err).NotTo(gomega.HaveOccurred())
21432143
if !isControllerUP {
2144-
bringUpTKGController(svcClient, tkgReplicaCount)
2145-
bringUpCsiController(gcClient, csiReplicaCount)
2144+
bringUpTKGController(svcClient, tkgReplicaCount, vsphereTKGSystemNamespace)
2145+
bringUpCsiController(gcClient, csiReplicaCount, vsphereTKGSystemNamespace)
21462146
}
21472147
err = fpv.DeletePersistentVolumeClaim(ctx, client, pvc.Name, namespace)
21482148
gomega.Expect(err).NotTo(gomega.HaveOccurred())
@@ -2161,8 +2161,8 @@ var _ = ginkgo.Describe("Volume health check", func() {
21612161
gomega.Expect(pvclaim.Annotations[volumeHealthAnnotation]).Should(gomega.BeEquivalentTo(healthStatusAccessible))
21622162

21632163
ginkgo.By("Bring down csi-controller pod in GC")
2164-
bringDownTKGController(svcClient)
2165-
bringDownCsiController(gcClient)
2164+
bringDownTKGController(svcClient, vsphereTKGSystemNamespace)
2165+
bringDownCsiController(gcClient, vsphereTKGSystemNamespace)
21662166
isControllerUP = false
21672167

21682168
// Get SV PVC before PSOD.
@@ -2182,8 +2182,8 @@ var _ = ginkgo.Describe("Volume health check", func() {
21822182
gomega.Expect(err).NotTo(gomega.HaveOccurred())
21832183

21842184
ginkgo.By("Bring up csi-controller pod in GC")
2185-
bringUpTKGController(svcClient, tkgReplicaCount)
2186-
bringUpCsiController(gcClient, csiReplicaCount)
2185+
bringUpTKGController(svcClient, tkgReplicaCount, vsphereTKGSystemNamespace)
2186+
bringUpCsiController(gcClient, csiReplicaCount, vsphereTKGSystemNamespace)
21872187
isControllerUP = true
21882188

21892189
ginkgo.By("Verify health status of GC PVC after GC csi is up")

0 commit comments

Comments
 (0)