e2e: small fixes in var name and error msg

rookTolBoxPodLabel to rookToolBoxPodLabel
podPot to podOpt
fix error message for getting PV

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R 2021-03-18 15:31:16 +05:30 committed by mergify[bot]
parent 721640178b
commit 26c07aef02
3 changed files with 10 additions and 10 deletions

View File

@ -111,11 +111,11 @@ func getCommandInPodOpts(f *framework.Framework, c, ns string, opt *metav1.ListO
} }
func execCommandInPod(f *framework.Framework, c, ns string, opt *metav1.ListOptions) (string, string, error) { func execCommandInPod(f *framework.Framework, c, ns string, opt *metav1.ListOptions) (string, string, error) {
podPot, err := getCommandInPodOpts(f, c, ns, opt) podOpt, err := getCommandInPodOpts(f, c, ns, opt)
if err != nil { if err != nil {
return "", "", err return "", "", err
} }
stdOut, stdErr, err := f.ExecWithOptions(podPot) stdOut, stdErr, err := f.ExecWithOptions(podOpt)
if stdErr != "" { if stdErr != "" {
e2elog.Logf("stdErr occurred: %v", stdErr) e2elog.Logf("stdErr occurred: %v", stdErr)
} }
@ -124,13 +124,13 @@ func execCommandInPod(f *framework.Framework, c, ns string, opt *metav1.ListOpti
func execCommandInToolBoxPod(f *framework.Framework, c, ns string) (string, string, error) { func execCommandInToolBoxPod(f *framework.Framework, c, ns string) (string, string, error) {
opt := &metav1.ListOptions{ opt := &metav1.ListOptions{
LabelSelector: rookTolBoxPodLabel, LabelSelector: rookToolBoxPodLabel,
} }
podPot, err := getCommandInPodOpts(f, c, ns, opt) podOpt, err := getCommandInPodOpts(f, c, ns, opt)
if err != nil { if err != nil {
return "", "", err return "", "", err
} }
stdOut, stdErr, err := f.ExecWithOptions(podPot) stdOut, stdErr, err := f.ExecWithOptions(podOpt)
if stdErr != "" { if stdErr != "" {
e2elog.Logf("stdErr occurred: %v", stdErr) e2elog.Logf("stdErr occurred: %v", stdErr)
} }
@ -138,11 +138,11 @@ func execCommandInToolBoxPod(f *framework.Framework, c, ns string) (string, stri
} }
func execCommandInPodAndAllowFail(f *framework.Framework, c, ns string, opt *metav1.ListOptions) (string, string) { func execCommandInPodAndAllowFail(f *framework.Framework, c, ns string, opt *metav1.ListOptions) (string, string) {
podPot, err := getCommandInPodOpts(f, c, ns, opt) podOpt, err := getCommandInPodOpts(f, c, ns, opt)
if err != nil { if err != nil {
return "", err.Error() return "", err.Error()
} }
stdOut, stdErr, err := f.ExecWithOptions(podPot) stdOut, stdErr, err := f.ExecWithOptions(podOpt)
if err != nil { if err != nil {
e2elog.Logf("command %s failed: %v", c, err) e2elog.Logf("command %s failed: %v", c, err)
} }

View File

@ -144,7 +144,7 @@ func getPVCAndPV(c kubernetes.Interface, pvcName, pvcNamespace string) (*v1.Pers
} }
pv, err := c.CoreV1().PersistentVolumes().Get(context.TODO(), pvc.Spec.VolumeName, metav1.GetOptions{}) pv, err := c.CoreV1().PersistentVolumes().Get(context.TODO(), pvc.Spec.VolumeName, metav1.GetOptions{})
if err != nil { if err != nil {
return pvc, nil, fmt.Errorf("failed to delete PV with error %v", err) return pvc, nil, fmt.Errorf("failed to get PV with error %v", err)
} }
return pvc, pv, nil return pvc, pv, nil
} }

View File

@ -28,7 +28,7 @@ const (
defaultNs = "default" defaultNs = "default"
vaultSecretNs = "/secret/ceph-csi/" vaultSecretNs = "/secret/ceph-csi/"
rookTolBoxPodLabel = "app=rook-ceph-tools" rookToolBoxPodLabel = "app=rook-ceph-tools"
rbdmountOptions = "mountOptions" rbdmountOptions = "mountOptions"
retainPolicy = v1.PersistentVolumeReclaimRetain retainPolicy = v1.PersistentVolumeReclaimRetain