Skip to content

Conversation

@cbarbian-sap
Copy link
Contributor

@cbarbian-sap cbarbian-sap commented Dec 16, 2025

So far, instances of the KustomizeGenerator are 'fenced' to the directory which is passed as kustomizationPath when instantiating it. That means:

  • their kustomization.yaml (if present) cannot reference resources (bases) or patches outside that directory, such as ../bases
  • the readFile template function cannot reference files outside kustomizationPath.

This gap is addressed through this PR: two new attributes are recognized in .component-config.yaml:

  • includedKustomizations: []string: a list of directory paths relative to kustomizationPath; targeted directories are treated as own components, rendered with the including component's parameters (values), and then supplied to kustomize at the identical path
  • includedFiles: []string: a list of paths relative to kustomizationPath (single files or directories); all referenced files (recursively in case a directory is specified) can be used with readFile.

Recursive inclusions are possible, but must not lead to cycles (there is a circuit breaking logic that will fail the generator in case of cycles).

Example:

# mycomp/.component-config.yaml
includedFiles:
- ../meta.yaml
includedKustomizations:
- ../bases

Then, mycomp/kustomization.yaml can reference ../bases, such as

# mycomp/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../bases
# ...

and templates in mycomp can call readFile "../meta.yaml".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants