add new file access (in kustomize/helm generators)#278
Merged
Conversation
- add readFile/existsFile/listFiles methods to kustomize generator - add .Files builtin to helm generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ths PR enhances
HelmGeneratorandKustomizeGenerator, adding mechanisms to access files from the provided Helm chart resp. Kustomization directory.For
HelmGeneratorthat means, that the.Filesbuiltin is now supported. With some small differences to the original Helm behavior:Chart.yaml,templates/,crds/and so on) cannot be retrieved through.FilesHelmGeneratorcurrently does not honor the.helmignorefile at all, files that would be excluded with regular Helm can be accessed through.FileswithHelmGenerator.For
KustomizeGenerator, there are now three new template functions available:readFile: takes a path relative to the Kustomization directory and returns the raw content (as []byte slice)existsFile: also expects a path relative to the Kustomization directory and returns a boolean indicating whether the file exists or notlistFiles: accepts a pattern and returns a all matching file paths in the Kustomization directory as string list.