how can I keep a `Run` action from happening when ...
# 🤖|ask-kapa
m
Please stand by @most-tent-39133 as I search the knowledge base. I normally take about 15 seconds or so. :wave:
---------------------- Based on the knowledge sources, there isn't a direct configuration option to prevent a Run action from executing during
garden cleanup deploy
. Run actions in Garden are primarily designed to execute before other actions (like Deploys) that depend on them. As mentioned in the documentation, "Runs that have dependents (i.e. something that depends on them) are run automatically by Garden." [Using-garden > Runs]() When you execute
garden cleanup deploy
, Garden is designed to un-deploy the specified actions without considering dependencies in the same way as during deployment. The documentation states: "Note that this command does not take into account any deploys depending on the cleaned up actions, and might therefore leave the project in an unstable state." [Reference > Commands > garden cleanup deploy]() One potential approach would be to use the
disabled
configuration option conditionally. You could potentially create a template variable that indicates whether the action is being run during cleanup or deployment, and then use that to conditionally disable the Run action:
Copy code
yaml
kind: Run
name: my-run
disabled: ${some.condition.for.cleanup}
...
However, the knowledge sources don't specifically mention how to detect if an action is being executed during cleanup versus deployment. Another approach might be to make your Run action idempotent and have it check internally whether it needs to execute its logic or exit early, as suggested in the FAQ: "So what we generally do is to make sure Runs are idempotent and exit early if they shouldn't run again." [Misc > FAQ > Tests and Runs]()
If you need more specific guidance on this use case, you might want to check the Garden documentation further or reach out to the Garden community for additional assistance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
message has been deleted
2 Views