From c9cd8d7a37011e1ba5c4f6275ec48b8016e1dc0a Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Thu, 29 Jul 2021 17:14:50 +0530 Subject: [PATCH] e2e: sync data from rbd-nbd mount Until we have a real fix, just to avoid occasionally file system entering into read-only on nodeplugin restart, lets sync data from the application pod. Updates: #2204 Signed-off-by: Prasanna Kumar Kalever --- e2e/rbd.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/e2e/rbd.go b/e2e/rbd.go index 73c6bfefe..9481474aa 100644 --- a/e2e/rbd.go +++ b/e2e/rbd.go @@ -465,6 +465,21 @@ var _ = Describe("RBD", func() { e2elog.Failf("failed to create PVC and application with error %v", err) } + appOpt := metav1.ListOptions{ + LabelSelector: fmt.Sprintf("app=%s", app.Name), + } + // TODO: Remove this once we ensure that rbd-nbd can sync data + // from Filesystem layer to backend rbd image as part of its + // detach or SIGTERM signal handler + _, stdErr, err := execCommandInPod( + f, + fmt.Sprintf("sync %s", app.Spec.Containers[0].VolumeMounts[0].MountPath), + app.Namespace, + &appOpt) + if err != nil || stdErr != "" { + e2elog.Failf("failed to sync, err: %v, stdErr: %v ", err, stdErr) + } + // validate created backend rbd images validateRBDImageCount(f, 1, defaultRBDPool) @@ -537,9 +552,6 @@ var _ = Describe("RBD", func() { e2elog.Failf("failed to poll: %v", err) } - appOpt := metav1.ListOptions{ - LabelSelector: fmt.Sprintf("app=%s", app.Name), - } filePath := app.Spec.Containers[0].VolumeMounts[0].MountPath + "/test" _, stdErr, err = execCommandInPod( f,