mogensen / kubernetes-split-yaml

Split the 'giant yaml file' into one file pr kubernetes resource
99 stars 20 forks source link

[jjo] feat: add --cleanup_gotemplate=true flag #6

Closed jjo closed 1 year ago

jjo commented 4 years ago

Add --cleanup_gotemplate flag, defaulting to true (current behavior).

There are legitimate cases where we'd want to let gotemplate-like strings in the output files, notably Prometheus' alerting rules, which support gotemplate'd strings.

sonarcloud[bot] commented 4 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

mogensen commented 4 years ago

I'm not sure i understand the issue. The current release v0.3.0 preserves all gotemplating in the resulting yaml resource files. I have fixed the tests that runs the 'testdata/*.yamltests, and added an example in the simple.yaml file, that has gotemplate in it. And the test is validating that the resulting file (testdata/simple.yaml.golden/simple-namespace.yaml`) contains the same template tags.

Can you share an example where this does not work?

The only reason that the code is removing the templating tags right now, is to use the yaml parser, so we can get the namespace and name of the yaml. The actual content of the file is from before we remove the gotemplate tags.