Skip to content

Commit

Permalink
Fix waiting for volsync replication
Browse files Browse the repository at this point in the history
We waited on `.status.lastManualSync` right after creating the
replication source, but there is a window where status or
status.lastManualSync are not reported, and the wait fails with:

    drenv.commands.Error: Command failed:
       command: ('kubectl', 'wait', '--context', 'dr1', 'replicationsource/busybox-src',
               '--for=jsonpath={.status.lastManualSync}=replication-1', '--namespace=busybox',
               '--timeout=120s')
       exitcode: 1
       error:
          error: status is not found

Strangely this wait is not needed on the system I tested on, maybe
this depends on kubectl version.

Now wait until `status.lastManualSync` is reported before wait on the
expected value.

Reported-by: Travis Janssen <tjanssen@redhat.com>
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Jul 19, 2023
1 parent 9b74912 commit 0dd27ba
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/addons/volsync/test
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ def run_replication(cluster):
print(f"Creating replication source in cluster '{cluster}'")
kubectl.apply("--filename", "source/replication-src.yaml", context=cluster)

print(f"Waiting until replication source reports sync status in '{cluster}'")
drenv.wait_for(
"replicationsource/busybox-src",
output="jsonpath={.status.lastManualSync}",
namespace=NAMESPACE,
timeout=60,
profile=cluster,
)

print(f"Waiting until replication is completed in cluster '{cluster}'")
kubectl.wait(
"replicationsource/busybox-src",
Expand Down

0 comments on commit 0dd27ba

Please sign in to comment.