Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: exec recipe in ready condition #2479

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading