Skip to content

fix(cluster): correct override issue when updating Karpenter config#2792

Merged
rmnbrd merged 4 commits into
stagingfrom
fix/karpenter-config-override-issue
Jul 2, 2026
Merged

fix(cluster): correct override issue when updating Karpenter config#2792
rmnbrd merged 4 commits into
stagingfrom
fix/karpenter-config-override-issue

Conversation

@rmnbrd

@rmnbrd rmnbrd commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

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

  • Changes tested locally in the relevant Console's pages and Storybooks
  • yarn test or yarn test -u (if you need to regenerate snapshots)
  • yarn format
  • yarn lint

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible (e.g. feat(service): add new Terraform service) - required for semantic-release
  • I only kept necessary comments, written in English (watch for useless AI comments)
  • I involved a designer to validate UI changes if I am not a designer
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any AI-assisted code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 onChange handler 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.

@rmnbrd rmnbrd marked this pull request as ready for review July 2, 2026 15:19
@rmnbrd rmnbrd requested a review from RemiBonnet July 2, 2026 15:22
)
)

fireEvent.click(screen.getByRole('button', { name: /edit/i }))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use userEvent or just a simple click() here?

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.49%. Comparing base (752065d) to head (a98e043).

Files with missing lines Patch % Lines
...-resources-settings/cluster-resources-settings.tsx 0.00% 0 Missing and 2 partials ⚠️
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     
Flag Coverage Δ
unittests 47.49% <0.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rmnbrd rmnbrd merged commit 54fea81 into staging Jul 2, 2026
12 checks passed
@rmnbrd rmnbrd deleted the fix/karpenter-config-override-issue branch July 2, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants