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

support nested variable resolution #728

Merged
merged 2 commits into from
Mar 4, 2020
Merged

support nested variable resolution #728

merged 2 commits into from
Mar 4, 2020

Conversation

shivdudhani
Copy link
Contributor

fixes #727

Resolve the variables bottom-up (i.e. resolve the inner-most variable to the outer variables). Regular expression leveraged to identify the variables.

There are 2 possible scenarios:

  1. No inner variables {{variable}}. The resolved value can be scalar or non-scalar.
  2. Contains inner variables {{variable-{{variable}}}}. The inner values need to be scalar for the outer variable can be resolved{{variable-value}}. If the inner variable is non-scalar, the resolution is inconsistent so it's considered as failed variable resolution for reporting.

Limitations:

  • Only equal operator is supported for variables
  • In the inner-variable resolves to a non-scalar value, then it is considered as a failed variable.

pkg/engine/variables/vars.go Show resolved Hide resolved
pkg/engine/variables/vars.go Outdated Show resolved Hide resolved
@realshuting realshuting merged commit 0140aa6 into master Mar 4, 2020
@realshuting realshuting deleted the 727_feature branch March 4, 2020 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support nested variable resolution
3 participants