Skip to content

[Refactor]: Standardize ChaosEngine Toleration serialization to prevent data-loss regressions #5589

Description

@Aryanbhargava18

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

  1. Update KubernetesYamlService.ts to explicitly merge incoming tolerations with ...(manifest.spec.components?.runner?.tolerations || []).
  2. Ensure the same defensive spreading is applied to manifest.spec.experiments[0].spec.components.tolerations.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions