Skip to content

Commit

Permalink
fix: exec recipe in ready condition (#2479)
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 authored Jun 10, 2024
1 parent 93990ce commit 288ddba
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/docs/api-reference/starlark-reference/ready-condition.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,32 @@ def run(plan):
# finally we execute the add_service instruction using all the pre-configured data
plan.add_service(name = "web-server", config = service_config)
```
and with an `ExecRecipe`:

```python
def run(plan):
# we define the recipe first
exec_recipe = ExecRecipe(
command = ["echo '{"key":"Hi}'],
)

ready_conditions_config = ReadyCondition(
recipe = exec_recipe,
# note how the possible fields are based on the result of executing the ExecRecipe - in this case, .extract
field = "output"
assertion = "!=",
target_value = "",
interval = "10s",
timeout = "200s",
)

service_config = ServiceConfig(
image = "ubuntu",
ready_conditions= ready_conditions_config,
)

plan.add_service(name = "web-server", config = service_config)
```

<!--------------- ONLY LINKS BELOW THIS POINT ---------------------->

Expand Down

0 comments on commit 288ddba

Please sign in to comment.