-
Notifications
You must be signed in to change notification settings - Fork 167
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
chore: expression for vars value #7411
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7411 +/- ##
==========================================
+ Coverage 65.44% 65.47% +0.02%
==========================================
Files 343 343
Lines 41699 41756 +57
==========================================
+ Hits 27290 27339 +49
- Misses 12022 12031 +9
+ Partials 2387 2386 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
2ea476b
to
e4db5a9
Compare
e4db5a9
to
96b40c7
Compare
96b40c7
to
b28ea43
Compare
b28ea43
to
b958c44
Compare
} | ||
templateVars, envVars, err := ResolveTemplateNEnvVars(testCtx.Ctx, nil, synthesizedComp, vars) | ||
Expect(err).Should(Succeed()) | ||
Expect(templateVars).Should(HaveKeyWithValue("endpoint", "localhost:12345")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems to be an unexpected result, how about resolved for multiple passes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider such an example:
vars:
- name: a
value: 1
expression: {{.a}}+{{.b}}
- name: b
value: 1
expression: {{.a}}+{{.b}}
Even if we employ multiple passes to evaluate, it will never have a stable result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can exclue the possibility of circular dependencies. If a circular dependency is detected, an error should be thrown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we do not parse and understand the content of the expressions (it's too complicated to do that), we have no idea about whether there are any circular dependencies, we can only check whether further iteration is needed by comparing the results of the two previous evaluations. As for whether the iteration can be ended or how many more times it‘s needed, there is no way for us to know it in advance. It may keep iterating indefinitely, unless we set an upper limit on the number of iterations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set an upper limit on the number of iterations, throw an error if not converged. Sounds feasible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine, i will submit another PR to improve it.
/cherry-pick release-0.9 |
(cherry picked from commit 6e5ac26)
🤖 says: cherry pick action finished successfully 🎉! |
No description provided.