Description
While reviewing recent PRs related to ChaosEngine manifest generation, I noticed a structural flaw in how KubernetesYamlService.ts handles tolerations arrays for both runners and experiments.
Currently, when the UI updates the manifest, it has a tendency to overwrite existing tolerations rather than appending to them. If a user has pre-configured multiple node tolerations (e.g., for different edge/cloud node pools) and then updates the experiment via the UI, the serialization logic drops the existing array elements.
Proposed Solution
- Update
KubernetesYamlService.ts to explicitly merge incoming tolerations with ...(manifest.spec.components?.runner?.tolerations || []).
- Ensure the same defensive spreading is applied to
manifest.spec.experiments[0].spec.components.tolerations.
- Add defensive unit tests specifically for the serialization merge behavior to prevent future PRs from inadvertently introducing array overwrites.
I can submit a PR for this immediately to lock down the data integrity.
Description
While reviewing recent PRs related to ChaosEngine manifest generation, I noticed a structural flaw in how
KubernetesYamlService.tshandlestolerationsarrays for both runners and experiments.Currently, when the UI updates the manifest, it has a tendency to overwrite existing tolerations rather than appending to them. If a user has pre-configured multiple node tolerations (e.g., for different edge/cloud node pools) and then updates the experiment via the UI, the serialization logic drops the existing array elements.
Proposed Solution
KubernetesYamlService.tsto explicitly merge incoming tolerations with...(manifest.spec.components?.runner?.tolerations || []).manifest.spec.experiments[0].spec.components.tolerations.I can submit a PR for this immediately to lock down the data integrity.