Closed liangyuanpeng closed 3 months ago
In the current version:
_composeService = [{# omit the svc config} for i in range(5)]
If you encounter specific code implementation issues, I can provide a more detailed sample code.
Thanks for quickly reply and i will try the range
on tomorrow, seems like it's what i want!
closing.. range
is working for me.
Feature Request
Is your feature request related to a problem? Please describe:
Describe the feature you'd like:
I'm using kcl to generate configuration with docker-compose for etcd cluster, i want to set a param of cluster node count and then generate a cluster, and the kcl configuration like this:
This is very helpful for quickly generating a docker-compose file for a stateful service cluster! and seems like it's not support now: https://www.kcl-lang.io/docs/next/user_docs/support/faq-kcl#46-procedural-for-loop
The case2 is dynamically generate kind cluster configuration files for multiple kind nodes. https://github.com/kcl-lang/kcl/issues/1410
you can see that now i just use if
count==3
/count ==5
for it (:Describe alternatives you've considered:
Teachability, Documentation, Adoption, Migration Strategy: