From c2cda4909ba653a1c9fb0dd0e8ec62fd52e672ad Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Fri, 25 Jun 2021 18:37:12 +0530 Subject: [PATCH] e2e: reformat long lines in this package to 120 chars We have many declarations and invocations..etc with long lines which are very difficult to follow while doing code reading. This address the issues in 'e2e/upgrade_*.go' files to restrict the line length to 120 chars. Signed-off-by: Humble Chirammal --- e2e/upgrade-cephfs.go | 28 ++++++++++++++++++++++------ e2e/upgrade-rbd.go | 28 ++++++++++++++++++++++------ 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/e2e/upgrade-cephfs.go b/e2e/upgrade-cephfs.go index 86889e391..1a993117b 100644 --- a/e2e/upgrade-cephfs.go +++ b/e2e/upgrade-cephfs.go @@ -112,11 +112,15 @@ var _ = Describe("CephFS Upgrade Testing", func() { if err != nil { e2elog.Failf("failed to delete configmap with error %v", err) } - err = c.CoreV1().Secrets(cephCSINamespace).Delete(context.TODO(), cephFSProvisionerSecretName, metav1.DeleteOptions{}) + err = c.CoreV1(). + Secrets(cephCSINamespace). + Delete(context.TODO(), cephFSProvisionerSecretName, metav1.DeleteOptions{}) if err != nil { e2elog.Failf("failed to delete provisioner secret with error %v", err) } - err = c.CoreV1().Secrets(cephCSINamespace).Delete(context.TODO(), cephFSNodePluginSecretName, metav1.DeleteOptions{}) + err = c.CoreV1(). + Secrets(cephCSINamespace). + Delete(context.TODO(), cephFSNodePluginSecretName, metav1.DeleteOptions{}) if err != nil { e2elog.Failf("failed to delete node secret with error %v", err) } @@ -191,7 +195,11 @@ var _ = Describe("CephFS Upgrade Testing", func() { filePath := filepath.Join(mountPath, "testClone") // create a test file at the mountPath. - _, stdErr := execCommandInPodAndAllowFail(f, fmt.Sprintf("echo %s > %s", data, filePath), app.Namespace, &opt) + _, stdErr := execCommandInPodAndAllowFail( + f, + fmt.Sprintf("echo %s > %s", data, filePath), + app.Namespace, + &opt) if stdErr != "" { e2elog.Failf("failed to write data to a file %s", stdErr) } @@ -289,7 +297,10 @@ var _ = Describe("CephFS Upgrade Testing", func() { } if strings.Compare(newCheckSum, checkSum) != 0 { - e2elog.Failf("The checksum of files did not match, expected %s received %s ", checkSum, newCheckSum) + e2elog.Failf( + "The checksum of files did not match, expected %s received %s ", + checkSum, + newCheckSum) } e2elog.Logf("The checksum of files matched") @@ -350,7 +361,10 @@ var _ = Describe("CephFS Upgrade Testing", func() { } if strings.Compare(newCheckSum, checkSum) != 0 { - e2elog.Failf("The checksum of files did not match, expected %s received %s", checkSum, newCheckSum) + e2elog.Failf( + "The checksum of files did not match, expected %s received %s", + checkSum, + newCheckSum) } e2elog.Logf("The checksum of files matched") @@ -373,7 +387,9 @@ var _ = Describe("CephFS Upgrade Testing", func() { opt := metav1.ListOptions{ LabelSelector: fmt.Sprintf("%s=%s", appKey, label[appKey]), } - pvc, err = f.ClientSet.CoreV1().PersistentVolumeClaims(pvc.Namespace).Get(context.TODO(), pvc.Name, metav1.GetOptions{}) + pvc, err = f.ClientSet.CoreV1(). + PersistentVolumeClaims(pvc.Namespace). + Get(context.TODO(), pvc.Name, metav1.GetOptions{}) if err != nil { e2elog.Failf("failed to get pvc with error %v", err) } diff --git a/e2e/upgrade-rbd.go b/e2e/upgrade-rbd.go index a0b361582..009d3f249 100644 --- a/e2e/upgrade-rbd.go +++ b/e2e/upgrade-rbd.go @@ -119,11 +119,15 @@ var _ = Describe("RBD Upgrade Testing", func() { if err != nil { e2elog.Failf("failed to delete configmap with error %v", err) } - err = c.CoreV1().Secrets(cephCSINamespace).Delete(context.TODO(), rbdProvisionerSecretName, metav1.DeleteOptions{}) + err = c.CoreV1(). + Secrets(cephCSINamespace). + Delete(context.TODO(), rbdProvisionerSecretName, metav1.DeleteOptions{}) if err != nil { e2elog.Failf("failed to delete provisioner secret with error %v", err) } - err = c.CoreV1().Secrets(cephCSINamespace).Delete(context.TODO(), rbdNodePluginSecretName, metav1.DeleteOptions{}) + err = c.CoreV1(). + Secrets(cephCSINamespace). + Delete(context.TODO(), rbdNodePluginSecretName, metav1.DeleteOptions{}) if err != nil { e2elog.Failf("failed to delete node secret with error %v", err) } @@ -206,7 +210,11 @@ var _ = Describe("RBD Upgrade Testing", func() { filePath := filepath.Join(mountPath, "testClone") // create a test file at the mountPath. - _, stdErr := execCommandInPodAndAllowFail(f, fmt.Sprintf("echo %s > %s", data, filePath), app.Namespace, &opt) + _, stdErr := execCommandInPodAndAllowFail( + f, + fmt.Sprintf("echo %s > %s", data, filePath), + app.Namespace, + &opt) if stdErr != "" { e2elog.Failf("failed to write data to a file %s", stdErr) } @@ -307,7 +315,10 @@ var _ = Describe("RBD Upgrade Testing", func() { e2elog.Failf("failed to calculate checksum with error %v", err) } if strings.Compare(newCheckSum, checkSum) != 0 { - e2elog.Failf("The checksum of files did not match, expected %s received %s ", checkSum, newCheckSum) + e2elog.Failf( + "The checksum of files did not match, expected %s received %s", + checkSum, + newCheckSum) } e2elog.Logf("The checksum of files matched") @@ -356,7 +367,10 @@ var _ = Describe("RBD Upgrade Testing", func() { e2elog.Failf("failed to calculate checksum with error %v", err) } if strings.Compare(newCheckSum, checkSum) != 0 { - e2elog.Failf("The checksum of files did not match, expected %s received %s ", checkSum, newCheckSum) + e2elog.Failf( + "The checksum of files did not match, expected %s received %s", + checkSum, + newCheckSum) } e2elog.Logf("The checksum of files matched") @@ -380,7 +394,9 @@ var _ = Describe("RBD Upgrade Testing", func() { LabelSelector: fmt.Sprintf("%s=%s", appKey, label[appKey]), } var err error - pvc, err = f.ClientSet.CoreV1().PersistentVolumeClaims(pvc.Namespace).Get(context.TODO(), pvc.Name, metav1.GetOptions{}) + pvc, err = f.ClientSet.CoreV1(). + PersistentVolumeClaims(pvc.Namespace). + Get(context.TODO(), pvc.Name, metav1.GetOptions{}) if err != nil { e2elog.Failf("failed to get pvc with error %v", err) }