mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-26 00:00:23 +00:00
ci: execCommandInDaemonsetPod should not return unused stdout
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
5c1584671e
commit
782f08e2f0
@ -154,7 +154,7 @@ func unmountCephFSVolume(f *framework.Framework, appName, pvcName string) error
|
||||
"umount /var/lib/kubelet/pods/%s/volumes/kubernetes.io~csi/%s/mount",
|
||||
pod.UID,
|
||||
pvc.Spec.VolumeName)
|
||||
_, stdErr, err := execCommandInDaemonsetPod(
|
||||
stdErr, err := execCommandInDaemonsetPod(
|
||||
f,
|
||||
cmd,
|
||||
cephFSDeamonSetName,
|
||||
|
17
e2e/pod.go
17
e2e/pod.go
@ -137,13 +137,16 @@ func getCommandInPodOpts(
|
||||
}, nil
|
||||
}
|
||||
|
||||
// execCommandInDaemonsetPod executes commands inside given container of a daemonset pod on a particular node.
|
||||
// execCommandInDaemonsetPod executes commands inside given container of a
|
||||
// daemonset pod on a particular node.
|
||||
//
|
||||
// stderr is returned as a string, and err will be set on a failure.
|
||||
func execCommandInDaemonsetPod(
|
||||
f *framework.Framework,
|
||||
c, daemonsetName, nodeName, containerName, ns string) (string, string, error) {
|
||||
c, daemonsetName, nodeName, containerName, ns string) (string, error) {
|
||||
selector, err := getDaemonSetLabelSelector(f, ns, daemonsetName)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
return "", err
|
||||
}
|
||||
|
||||
opt := &metav1.ListOptions{
|
||||
@ -151,7 +154,7 @@ func execCommandInDaemonsetPod(
|
||||
}
|
||||
pods, err := listPods(f, ns, opt)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
return "", err
|
||||
}
|
||||
|
||||
podName := ""
|
||||
@ -161,7 +164,7 @@ func execCommandInDaemonsetPod(
|
||||
}
|
||||
}
|
||||
if podName == "" {
|
||||
return "", "", fmt.Errorf("%s daemonset pod on node %s in namespace %s not found", daemonsetName, nodeName, ns)
|
||||
return "", fmt.Errorf("%s daemonset pod on node %s in namespace %s not found", daemonsetName, nodeName, ns)
|
||||
}
|
||||
|
||||
cmd := []string{"/bin/sh", "-c", c}
|
||||
@ -174,7 +177,9 @@ func execCommandInDaemonsetPod(
|
||||
CaptureStderr: true,
|
||||
}
|
||||
|
||||
return f.ExecWithOptions(podOpt)
|
||||
_ /* stdout */, stderr, err := f.ExecWithOptions(podOpt)
|
||||
|
||||
return stderr, err
|
||||
}
|
||||
|
||||
// listPods returns slice of pods matching given ListOptions and namespace.
|
||||
|
Loading…
Reference in New Issue
Block a user