mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-19 11:30:24 +00:00
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/rbd_helper.go' files to restrict the line length to 120 chars. Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
parent
f07c5ab857
commit
971f8e320b
@ -35,7 +35,12 @@ func rbdOptions(pool string) string {
|
|||||||
return "--pool=" + pool
|
return "--pool=" + pool
|
||||||
}
|
}
|
||||||
|
|
||||||
func createRBDStorageClass(c kubernetes.Interface, f *framework.Framework, name string, scOptions, parameters map[string]string, policy v1.PersistentVolumeReclaimPolicy) error {
|
func createRBDStorageClass(
|
||||||
|
c kubernetes.Interface,
|
||||||
|
f *framework.Framework,
|
||||||
|
name string,
|
||||||
|
scOptions, parameters map[string]string,
|
||||||
|
policy v1.PersistentVolumeReclaimPolicy) error {
|
||||||
scPath := fmt.Sprintf("%s/%s", rbdExamplePath, "storageclass.yaml")
|
scPath := fmt.Sprintf("%s/%s", rbdExamplePath, "storageclass.yaml")
|
||||||
sc, err := getStorageClass(scPath)
|
sc, err := getStorageClass(scPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -211,8 +216,14 @@ func validateImageOwner(pvcPath string, f *framework.Framework) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
stdOut, stdErr, err := execCommandInToolBoxPod(f,
|
stdOut, stdErr, err := execCommandInToolBoxPod(
|
||||||
fmt.Sprintf("rados %s getomapval csi.volume.%s %s", rbdOptions(defaultRBDPool), imageData.imageID, ownerKey), rookNamespace)
|
f,
|
||||||
|
fmt.Sprintf(
|
||||||
|
"rados %s getomapval csi.volume.%s %s",
|
||||||
|
rbdOptions(defaultRBDPool),
|
||||||
|
imageData.imageID,
|
||||||
|
ownerKey),
|
||||||
|
rookNamespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -221,7 +232,11 @@ func validateImageOwner(pvcPath string, f *framework.Framework) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if radosNamespace != "" {
|
if radosNamespace != "" {
|
||||||
e2elog.Logf("found image journal %s in pool %s namespace %s", "csi.volume."+imageData.imageID, defaultRBDPool, radosNamespace)
|
e2elog.Logf(
|
||||||
|
"found image journal %s in pool %s namespace %s",
|
||||||
|
"csi.volume."+imageData.imageID,
|
||||||
|
defaultRBDPool,
|
||||||
|
radosNamespace)
|
||||||
} else {
|
} else {
|
||||||
e2elog.Logf("found image journal %s in pool %s", "csi.volume."+imageData.imageID, defaultRBDPool)
|
e2elog.Logf("found image journal %s in pool %s", "csi.volume."+imageData.imageID, defaultRBDPool)
|
||||||
}
|
}
|
||||||
@ -628,7 +643,10 @@ func checkPVCImageInPool(f *framework.Framework, pvc *v1.PersistentVolumeClaim,
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkPVCDataPoolForImageInPool(f *framework.Framework, pvc *v1.PersistentVolumeClaim, pool, dataPool string) error {
|
func checkPVCDataPoolForImageInPool(
|
||||||
|
f *framework.Framework,
|
||||||
|
pvc *v1.PersistentVolumeClaim,
|
||||||
|
pool, dataPool string) error {
|
||||||
stdOut, err := getPVCImageInfoInPool(f, pvc, pool)
|
stdOut, err := getPVCImageInfoInPool(f, pvc, pool)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -657,7 +675,11 @@ func checkPVCImageJournalInPool(f *framework.Framework, pvc *v1.PersistentVolume
|
|||||||
}
|
}
|
||||||
|
|
||||||
if radosNamespace != "" {
|
if radosNamespace != "" {
|
||||||
e2elog.Logf("found image journal %s in pool %s namespace %s", "csi.volume."+imageData.imageID, pool, radosNamespace)
|
e2elog.Logf(
|
||||||
|
"found image journal %s in pool %s namespace %s",
|
||||||
|
"csi.volume."+imageData.imageID,
|
||||||
|
pool,
|
||||||
|
radosNamespace)
|
||||||
} else {
|
} else {
|
||||||
e2elog.Logf("found image journal %s in pool %s", "csi.volume."+imageData.imageID, pool)
|
e2elog.Logf("found image journal %s in pool %s", "csi.volume."+imageData.imageID, pool)
|
||||||
}
|
}
|
||||||
@ -671,8 +693,15 @@ func checkPVCCSIJournalInPool(f *framework.Framework, pvc *v1.PersistentVolumeCl
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, stdErr, err := execCommandInToolBoxPod(f,
|
_, stdErr, err := execCommandInToolBoxPod(
|
||||||
fmt.Sprintf("rados getomapval %s csi.volumes.default csi.volume.%s", rbdOptions(pool), imageData.pvName), rookNamespace)
|
f,
|
||||||
|
fmt.Sprintf(
|
||||||
|
"rados getomapval %s csi.volumes.default csi.volume.%s",
|
||||||
|
rbdOptions(pool),
|
||||||
|
imageData.pvName,
|
||||||
|
),
|
||||||
|
rookNamespace,
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -681,7 +710,11 @@ func checkPVCCSIJournalInPool(f *framework.Framework, pvc *v1.PersistentVolumeCl
|
|||||||
}
|
}
|
||||||
|
|
||||||
if radosNamespace != "" {
|
if radosNamespace != "" {
|
||||||
e2elog.Logf("found CSI journal entry %s in pool %s namespace %s", "csi.volume."+imageData.pvName, pool, radosNamespace)
|
e2elog.Logf(
|
||||||
|
"found CSI journal entry %s in pool %s namespace %s",
|
||||||
|
"csi.volume."+imageData.pvName,
|
||||||
|
pool,
|
||||||
|
radosNamespace)
|
||||||
} else {
|
} else {
|
||||||
e2elog.Logf("found CSI journal entry %s in pool %s", "csi.volume."+imageData.pvName, pool)
|
e2elog.Logf("found CSI journal entry %s in pool %s", "csi.volume."+imageData.pvName, pool)
|
||||||
}
|
}
|
||||||
@ -701,7 +734,11 @@ func deletePVCImageJournalInPool(f *framework.Framework, pvc *v1.PersistentVolum
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if stdErr != "" {
|
if stdErr != "" {
|
||||||
return fmt.Errorf("failed to remove omap %s csi.volume.%s with error %v", rbdOptions(pool), imageData.imageID, stdErr)
|
return fmt.Errorf(
|
||||||
|
"failed to remove omap %s csi.volume.%s with error %v",
|
||||||
|
rbdOptions(pool),
|
||||||
|
imageData.imageID,
|
||||||
|
stdErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@ -713,13 +750,22 @@ func deletePVCCSIJournalInPool(f *framework.Framework, pvc *v1.PersistentVolumeC
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, stdErr, err := execCommandInToolBoxPod(f,
|
_, stdErr, err := execCommandInToolBoxPod(
|
||||||
fmt.Sprintf("rados rmomapkey %s csi.volumes.default csi.volume.%s", rbdOptions(pool), imageData.pvName), rookNamespace)
|
f,
|
||||||
|
fmt.Sprintf(
|
||||||
|
"rados rmomapkey %s csi.volumes.default csi.volume.%s",
|
||||||
|
rbdOptions(pool),
|
||||||
|
imageData.pvName),
|
||||||
|
rookNamespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if stdErr != "" {
|
if stdErr != "" {
|
||||||
return fmt.Errorf("failed to remove %s csi.volumes.default csi.volume.%s with error %v", rbdOptions(pool), imageData.imageID, stdErr)
|
return fmt.Errorf(
|
||||||
|
"failed to remove %s csi.volumes.default csi.volume.%s with error %v",
|
||||||
|
rbdOptions(pool),
|
||||||
|
imageData.imageID,
|
||||||
|
stdErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user