fix(cluster): correct override issue when updating Karpenter config#2792
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses an override-loss issue when updating the Karpenter instance-type scope from the “Edit” modal in the cluster resources settings. The goal is to preserve existing Karpenter nodepool override configuration while updating only the instance-type requirements/architecture.
Changes:
- Update the Karpenter modal
onChangehandler to merge new values with existing Karpenter state and preserve nodepool override fields. - Add a regression test to ensure nodepool overrides remain intact when instance-type scope is changed via the modal.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| libs/domains/clusters/feature/src/lib/cluster-resources-settings/cluster-resources-settings.tsx | Adjusts the setValue('karpenter', ...) merge strategy when applying modal changes. |
| libs/domains/clusters/feature/src/lib/cluster-resources-settings/cluster-resources-settings.spec.tsx | Adds a test verifying nodepool overrides are preserved across modal-driven updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) | ||
| ) | ||
|
|
||
| fireEvent.click(screen.getByRole('button', { name: /edit/i })) |
There was a problem hiding this comment.
Could you use userEvent or just a simple click() here?
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## staging #2792 +/- ##
===========================================
+ Coverage 47.44% 47.49% +0.05%
===========================================
Files 1267 780 -487
Lines 26812 19556 -7256
Branches 7913 5946 -1967
===========================================
- Hits 12721 9289 -3432
+ Misses 11892 8622 -3270
+ Partials 2199 1645 -554
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Some of the Karpenter config gets overwritten
Issue: Slack thread
This PR fixes an issue where some of the Karpenter configuration was overwritten even though it was not updated by the user.
Reproduction steps can be found in the Slack thread.
Testing
yarn testoryarn test -u(if you need to regenerate snapshots)yarn formatyarn lintPR Checklist
.cursor/rules)feat(service): add new Terraform service) - required for semantic-release