Skip step on rollback

Hi,

I have a custom plugin that updates files in a github repository (part of a gitops setup). The MODIFY rule has a “wait” step to verify that the github commit triggered a corresponding deployment in Openshift/Kubernetes.

It’s all working well but I don’t want the “wait” step to execute during a rollback. The reason is that if the deployment failed while waiting in the first place it is likely that the rollback will fail too on that wait step. This leaves the XLD in a bit of an unknown state.

I added the wait step from the planning script like this:

   context.addStep(steps.jython(
     description="Waiting for {0} to be healthy".format(deployedApplication.name),
            script="xld/argocd/steps/wait_sync.py",
            jython_context = {"deployedApplication": deployedApplication, "deployed": deployed},
            order=deployed.executeOrder+20
        ))

Note that i’m not using addStepWithCheckpoint. However on a rollback this wait step is still being included in the plan. Is there a way to avoid adding this step to the rollback plan?

thanks