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

Fix Subnet update error detection #991

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

yanjunz97
Copy link
Contributor

@yanjunz97 yanjunz97 commented Jan 6, 2025

Operator modifies the existing Subnet in store before updating the NSX Subnet,
which results in the next reconcile will find the updated Subnet already in store,
skip the update, and overwrite the Status as Ready.
This PR uses a copy when updating the Subnet to avoid this issue.

@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.

Project coverage is 74.22%. Comparing base (8b979ba) to head (d94f593).

Files with missing lines Patch % Lines
pkg/nsx/services/subnet/subnet.go 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #991      +/-   ##
==========================================
+ Coverage   74.12%   74.22%   +0.10%     
==========================================
  Files         118      118              
  Lines       16384    16378       -6     
==========================================
+ Hits        12144    12157      +13     
+ Misses       3466     3451      -15     
+ Partials      774      770       -4     
Flag Coverage Δ
unit-tests 74.22% <95.45%> (+0.10%) ⬆️
Files with missing lines Coverage Δ
pkg/nsx/services/subnet/builder.go 87.67% <100.00%> (+0.17%) ⬆️
pkg/nsx/services/subnet/subnet.go 70.27% <94.11%> (+4.97%) ⬆️

pkg/nsx/services/subnet/subnet.go Outdated Show resolved Hide resolved
pkg/nsx/services/subnet/subnet.go Show resolved Hide resolved
pkg/nsx/services/subnet/subnet_test.go Outdated Show resolved Hide resolved
@yanjunz97 yanjunz97 force-pushed the fix-subnet-update branch 4 times, most recently from ecf2948 to eca3d76 Compare January 13, 2025 03:35
dantingl
dantingl previously approved these changes Jan 15, 2025
@yanjunz97 yanjunz97 force-pushed the fix-subnet-update branch 3 times, most recently from 61f5514 to 972aed5 Compare January 16, 2025 07:35
@yanjunz97 yanjunz97 requested review from TaoZou1 and dantingl January 16, 2025 07:36
@yanjunz97 yanjunz97 merged commit 954ed89 into vmware-tanzu:main Jan 17, 2025
2 checks passed
yanjunz97 added a commit to yanjunz97/nsx-operator that referenced this pull request Jan 17, 2025
Operator modifies the existing Subnet in store before updating the NSX Subnet,
which results in the next reconcile will find the updated Subnet already in store,
skip the update, and overwrite the Status as Ready.
This PR uses a copy when updating the Subnet to avoid this issue.

Signed-off-by: Yanjun Zhou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants