mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 14:20:19 +00:00
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:
parent
721640178b
commit
26c07aef02
14
e2e/pod.go
14
e2e/pod.go
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,8 @@ 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
|
||||||
// deletePolicy is the default policy in E2E.
|
// deletePolicy is the default policy in E2E.
|
||||||
|
Loading…
Reference in New Issue
Block a user