Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not patch field managers for Patch resources #2640

Merged
merged 4 commits into from
Oct 26, 2023

Conversation

rquitales
Copy link
Contributor

@rquitales rquitales commented Oct 26, 2023

Proposed changes

This pull request addresses the issue where Patch resources unintentionally patch field managers during update operations (ie. when a Patch resource is updated and reused). Such modification results in the Patch resource taking control of all fields managed owned by a field manager with the prefix kubectl. This, in turn, leads to unintended unset fields when running pulumi up. Patch resources are designed to contain a specific subset of fields for updating, and they should not interfere with the field managers of normal resources. It's important to note that field managers still need to be patched for regular resources, as they facilitate the transition from Client-Side Apply (CSA) to Server-Side Apply (SSA) for existing Pulumi-managed resources.

Additionally, this PR includes a new test to validate this behavior. The test will fail if the logic to avoid field manager patching for Patch resources is not implemented.

Related issues:

Fixes: #2639

@rquitales rquitales requested review from EronWright, a team and lblackstone October 26, 2023 08:13
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Merging #2640 (47397a6) into master (f3498a9) will decrease coverage by 0.02%.
Report is 1 commits behind head on master.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #2640      +/-   ##
==========================================
- Coverage   18.34%   18.33%   -0.02%     
==========================================
  Files          47       47              
  Lines        9625     9632       +7     
==========================================
  Hits         1766     1766              
- Misses       7760     7767       +7     
  Partials       99       99              
Files Coverage Δ
provider/pkg/await/await.go 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rquitales rquitales enabled auto-merge (squash) October 26, 2023 15:48
@pulumi-bot pulumi-bot added the needs-triage Needs attention from the triage team label Oct 26, 2023
@rquitales rquitales merged commit 70dce7d into master Oct 26, 2023
20 checks passed
@rquitales rquitales deleted the rquitales/fix-patch-update branch October 26, 2023 16:27
Copy link
Member

@lblackstone lblackstone left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Needs attention from the triage team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setting ignoreChanges on patch resource causes fields not owned by Pulumi to be wiped out
3 participants