You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When nesting charts within a parent chart, applying the parent chart to an app and then synthesizing the app, I'm seeing duplicated synthed resources - one file for each separate chart nested in the parent chart, and then one file for the parent chart which also includes the resources from the nested charts.
This is problematic when applying to Kubernetes using kubectl apply -f dist/ as the files contain duplicate identically named resources. Not sure if this is expected or not but submitting as a bug report just in case 🙂
I'm not bothered what the correct output is here. It seems to me that output should either be in individual files (one per nested child, with the parent resources in their own file) or all resources should be put into the one parent file. I don't think it matters, as long as the directory itself doesn't contain duplicate resources.
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered:
Fixes#31
I think the expected behavior from users is that in most circumstances, you should be able to directly apply resources generated by `cdk8s synth` to your k8s cluster (e.g. via `kubectl apply -f dist/`). However, it's possible for nested charts to cause resources to be listed twice. This PR resolves this by de-duplicating resources so that each one is only rendered once during a given "synth" call.
This PR makes the assumption that nesting charts within each other is implicitly a feature (I don't believe there are any other ways to arrive at charts containing the same resource twice?). It's possible we could instead add some kind of validation to prevent charts from being nested to resolve this issue instead, but this would become problematic if users are defining constructs that include charts.
Questions:
- Should there be some way to synthesize a specific chart within an app from the CLI?
- Should there be an option for synthesis (e.g. a CLI flag) to override this and allow duplicate objects?
Description of the bug:
When nesting charts within a parent chart, applying the parent chart to an app and then synthesizing the app, I'm seeing duplicated synthed resources - one file for each separate chart nested in the parent chart, and then one file for the parent chart which also includes the resources from the nested charts.
This is problematic when applying to Kubernetes using
kubectl apply -f dist/
as the files contain duplicate identically named resources. Not sure if this is expected or not but submitting as a bug report just in case 🙂Reproduction Steps:
app/test.ts
:shell
:Environment:
Other:
I'm not bothered what the correct output is here. It seems to me that output should either be in individual files (one per nested child, with the parent resources in their own file) or all resources should be put into the one parent file. I don't think it matters, as long as the directory itself doesn't contain duplicate resources.
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: