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

Extend file module functions (for smoother GitOps) #1267

Closed
dennybaa opened this issue May 2, 2024 · 3 comments · Fixed by #1271, #1277, #1286, #1293 or #1295
Closed

Extend file module functions (for smoother GitOps) #1267

dennybaa opened this issue May 2, 2024 · 3 comments · Fixed by #1271, #1277, #1286, #1293 or #1295
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed stdlib Issues or PRs related to kcl standard libraries

Comments

@dennybaa
Copy link

dennybaa commented May 2, 2024

Hello there!

KCL being a very capable versatile language should have more file system control functions:

  • mkdir
  • delete
    And maybe even more than this.

It's essential to have control over transitional file creation/deletion and placement. For instance in my case, I do generate prometheus rules from parameterized KCL definitions as the first step:

cd appsops/rules/graph && mkdir -p rules manifests && kcl -dY ./kcl.yaml
generate_rules:
- graph/rules/common-certmanager.yaml
- graph/rules/common-elasticsearch.yaml
- graph/rules/common-istio.yaml
- graph/rules/common-k8s-events.yaml
- graph/rules/common-k8s-nodes.yaml
- graph/rules/common-k8s-resources.yaml
- graph/rules/common-vector.yaml

This is the configuration entry for the next stage, which proceeds with VMRule manifests generation. Simply there should be enough control in place on where to place the files, how to create or delete them to enable smooth GitOps experience out of box. In fact KCL can be and should be used independently to provide a solid GitOps experience.

@Peefy
Copy link
Contributor

Peefy commented May 2, 2024

I agree. The file system module have beed added in KCL v0.8 and it needs to be extended more at future.

@Peefy Peefy added help wanted Extra attention is needed enhancement New feature or request stdlib Issues or PRs related to kcl standard libraries good first issue Good for newcomers labels May 2, 2024
@shruti2522
Copy link
Contributor

Sounds interesting. Would try to raise a PR covering the mkdir and delete functions.

@Peefy
Copy link
Contributor

Peefy commented May 3, 2024

Thank you @shruti2522.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed stdlib Issues or PRs related to kcl standard libraries
Projects
None yet
3 participants