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

Partition helm templated resources into CRDs and other resources #3

Open
tvandinther opened this issue Dec 20, 2024 · 0 comments
Open
Labels
enhancement New feature or request proposal A new feature which may not be implemented and requires further discussion or use cases.

Comments

@tvandinther
Copy link
Owner

The helm.template(chart) function currently returns a list of all resources for the given chart. If CRDs are part of the template, these are included in the list. There may be situations where you want to separate these in your configuration. The helm commands offer an includeCrds flag which could be exposed, or alternatively CRDs could always be returned but instead of returning a list of resource manifests [resource], a map of {crds: [resource], resources: [resource]} could be returned (i.e. pre-partitioned.

All of this could also be unnecessary as there are tools to handle this yourself within KCL such as guarded list comprehensions and filters. The following code snippets will achieve the desired outcome:

manifests = [m for m in helm.template(argoCd.Chart{}) if m.kind != "CustomResourceDefinition"]
_manifests: [any] = helm.template(argoCd.Chart{})
manifests = filter m in _manifests {
    m.kind != "CustomResourceDefinition"
}

Given that KCL offers this ability, I don't see a strong need for exposing a flag to include CRDs. If performance ever becomes an issue (by having CRDs unnecessarily rendered) then this could be revisited.

@tvandinther tvandinther added enhancement New feature or request proposal A new feature which may not be implemented and requires further discussion or use cases. labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request proposal A new feature which may not be implemented and requires further discussion or use cases.
Projects
None yet
Development

No branches or pull requests

1 participant