mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-09 16:00:22 +00:00
e2e: add util to get kernel version from specified container
Currently, we get the kernel version where the e2e (client) executable runs, not the kernel version that is used by the csi-rbdplugin pod. Add a function that run `uname -r` command from the specified container and returns the kernel version. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Suggested-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
4f40213d8e
commit
1bd2d46cdb
19
e2e/pod.go
19
e2e/pod.go
@ -406,3 +406,22 @@ func calculateSHA512sum(f *framework.Framework, app *v1.Pod, filePath string, op
|
||||
|
||||
return checkSum, nil
|
||||
}
|
||||
|
||||
// getKernelVersionFromDaemonset gets the kernel version from the specified container.
|
||||
func getKernelVersionFromDaemonset(f *framework.Framework, ns, dsn, cn string) (string, error) {
|
||||
selector, err := getDaemonSetLabelSelector(f, ns, dsn)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
opt := metav1.ListOptions{
|
||||
LabelSelector: selector,
|
||||
}
|
||||
|
||||
kernelRelease, stdErr, err := execCommandInContainer(f, "uname -r", ns, cn, &opt)
|
||||
if err != nil || stdErr != "" {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return kernelRelease, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user