Skip to content

How do I use the result of a plan function in my Starlark? #699

Answered by mieubrisse
mieubrisse asked this question in Q&A
Discussion options

You must be logged in to vote

This isn't possible in current Kurtosis. Kurtosis uses a multi-phase approach when running, which means that all Starlark will be completely interpreted and done before any execution happens.

This has the benefit that Kurtosis can validate the complete plan of what the user is trying to do before anything runs, but has the downside that execution-time values (such as the result of curl) are not available in Starlark because the curl hasn't run yet.

Instead, the same thing can be accomplished by pushing the dynamic logic down to execution-time computation. For example:

recipe = ExecRecipe(command=["/bin/sh", "-c", "curl -XGET %s" % my_service.url])
result = plan.exec(service_name=service_name

Replies: 1 comment

Comment options

mieubrisse
Jun 9, 2023
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by mieubrisse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant