From e09837cc4c7d36740f05b7dd3435f88534b27208 Mon Sep 17 00:00:00 2001 From: danfengl Date: Thu, 18 Nov 2021 08:50:50 +0000 Subject: [PATCH] Fix snapshot e2e test issue of jsonpath Signed-off-by: danfengl --- changelogs/unreleased/4372-danfengliu | 1 + test/e2e/velero_utils.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/4372-danfengliu diff --git a/changelogs/unreleased/4372-danfengliu b/changelogs/unreleased/4372-danfengliu new file mode 100644 index 000000000..ca34a1b46 --- /dev/null +++ b/changelogs/unreleased/4372-danfengliu @@ -0,0 +1 @@ +Fix snapshot e2e test issue of jsonpath \ No newline at end of file diff --git a/test/e2e/velero_utils.go b/test/e2e/velero_utils.go index 7e8a8bb6a..09ef1407f 100644 --- a/test/e2e/velero_utils.go +++ b/test/e2e/velero_utils.go @@ -422,7 +422,7 @@ func veleroAddPluginsForProvider(ctx context.Context, veleroCLI string, veleroNa func waitForVSphereUploadCompletion(ctx context.Context, timeout time.Duration, namespace string) error { err := wait.PollImmediate(time.Minute, timeout, func() (bool, error) { checkSnapshotCmd := exec.CommandContext(ctx, "kubectl", - "get", "-n", namespace, "snapshots.backupdriver.cnsdp.vmware.com", "-o=jsonpath='{range .items[*]}{.spec.resourceHandle.name}{\"=\"}{.status.phase}{\"\\n\"}'") + "get", "-n", namespace, "snapshots.backupdriver.cnsdp.vmware.com", "-o=jsonpath='{range .items[*]}{.spec.resourceHandle.name}{\"=\"}{.status.phase}{\"\\n\"}{end}'") fmt.Printf("checkSnapshotCmd cmd =%v\n", checkSnapshotCmd) stdout, stderr, err := veleroexec.RunCommand(checkSnapshotCmd) if err != nil {