-
Notifications
You must be signed in to change notification settings - Fork 41
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
🚀 Support variables in Tirith policy #130
Comments
One important usecase: A policy wants to refer to a value in another JSON file (e.g. SG Template) so we don't need to change the value in the policy everytime the value changes Inspiration: https://developer.hashicorp.com/terraform/language/values/variables Tasks:
|
Related to #160 |
|
I think we need to accept the value as is,
Then we shouldn't run it on the workflow that wasn't created from a template right?
Per our last discussion, Tirith will just throw an error when the variable is not found.
I think we should, we can define a new key on the Policy object
Per our last discussion, we'll accept both, but Also, I'd do the reference by using |
Task description: How to replace the references in the policy with the actual variables before the evaluation
Steps:
Example:
Assuming the variable dict is there:
After replacement:
User can also put the reference string on another part of the policy, e.g. the Cases to test:
|
Is your feature request related to a problem? Please describe.
Tirith policies are hard-coded and do not support parameterization. Simple variation require the whole policy to written again.
Describe the solution you'd like
If there is a way to define variables in the policy and pass their values in the run-time through a separate file or inline in the tirith command, it would vastly help.
Describe alternatives you've considered
Re-writing the policies with all variations.
The text was updated successfully, but these errors were encountered: