-
Notifications
You must be signed in to change notification settings - Fork 12
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
Pod count evaluation #53
Conversation
- check if tc.task if not nil before access to the object Signed-off-by: Shinae Woo <[email protected]>
e.g., `podCount: "{{.parallelism}} * 2"` Signed-off-by: Shinae Woo <[email protected]>
e3db2bb
to
2edd30f
Compare
I was wondering if the use of
Then we use them in templates:
And the template will look like
|
We don't have to implement this, there already exists a library that provides what you have suggested -- https://github.com/Masterminds/sprig. It's the templating library that's used by helm and I believe some of our internal tools as well. Another advantage of using this library is that users get much more than the basic mathematical operations and not to mention the library is battle tested. With that said, both approaches (the one in implemented in this PR and the one suggest in this comment) achieve the same end result for this use case but take different approaches. My question is do we have use cases where users need to use more than just mathematical expressions? Because, if we don't then IMO we can stick to simple mathematical expression evaluation as used in the current approach. |
Multiple templates, such as Helm or Hugo, implement mathematical evaluations. The reason that I picked the current implementation was that
If we have other requirements beyond the current implementation, we can discuss them further, so please let me know if we have any. However, in such case, I would pick one existing implementation rather than introduce and implement our own template. |
Support arithmetic evaluation for PodCount in RegisterObj
e.g.,
"{{.parallelism}} * 2"
"{{.parallelism}} * {{.replicas}}"