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

Improve realizedstate check for resources with dependency #1014

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

yanjunz97
Copy link
Contributor

NSX LBS realization has dependency on the gateway-interface. If gateway-interface is not realized
before NSX LBS realization timeout, the realized state API will return a ProviderNotReady error.
But later on the NSX LBS realization can become Realized after the gateway-interface realization
succeeds. Thus for NSX operator, we enhance the realized state check to

  • Check gateway-interface when check the VPC realized state
  • Retry when ProviderNotReady error is detected

@codecov-commenter
Copy link

codecov-commenter commented Jan 26, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 74.86%. Comparing base (0bdd267) to head (236fead).

Files with missing lines Patch % Lines
pkg/nsx/services/vpc/vpc.go 0.00% 6 Missing ⚠️
pkg/nsx/util/errors.go 88.88% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           v4.2.0    #1014      +/-   ##
==========================================
+ Coverage   74.84%   74.86%   +0.01%     
==========================================
  Files         118      118              
  Lines       16389    16409      +20     
==========================================
+ Hits        12267    12285      +18     
- Misses       3355     3357       +2     
  Partials      767      767              
Flag Coverage Δ
unit-tests 74.86% <80.00%> (+0.01%) ⬆️
Files with missing lines Coverage Δ
pkg/nsx/services/common/types.go 100.00% <ø> (ø)
pkg/nsx/services/realizestate/realize_state.go 100.00% <100.00%> (ø)
pkg/nsx/services/subnet/subnet.go 70.27% <100.00%> (ø)
pkg/nsx/services/subnetport/subnetport.go 82.56% <100.00%> (ø)
pkg/nsx/util/errors.go 92.21% <88.88%> (-0.27%) ⬇️
pkg/nsx/services/vpc/vpc.go 55.08% <0.00%> (ø)

@yanjunz97 yanjunz97 force-pushed the improve-lbs-rs-420 branch 2 times, most recently from 32b1da0 to be73e26 Compare January 26, 2025 06:21
TaoZou1
TaoZou1 previously approved these changes Jan 26, 2025
TaoZou1
TaoZou1 previously approved these changes Jan 26, 2025
timdengyun
timdengyun previously approved these changes Jan 26, 2025
Copy link
Contributor

@timdengyun timdengyun left a comment

Choose a reason for hiding this comment

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

LGTM

pkg/nsx/util/errors.go Outdated Show resolved Hide resolved
@yanjunz97 yanjunz97 dismissed stale reviews from timdengyun and TaoZou1 via 236fead January 26, 2025 08:14
Copy link
Contributor

@timdengyun timdengyun left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks, yanjun

@timdengyun
Copy link
Contributor

We need pick to main branch

@yanjunz97 yanjunz97 merged commit 372154d into vmware-tanzu:v4.2.0 Jan 26, 2025
2 checks passed
yanjunz97 added a commit to yanjunz97/nsx-operator that referenced this pull request Jan 26, 2025
…zu#1014)

NSX LBS realization has dependency on the gateway-interface. If gateway-interface is not realized
before NSX LBS realization timeout, the realized state API will return a ProviderNotReady error.
But later on the NSX LBS realization can become Realized after the gateway-interface realization
succeeds. Thus for NSX operator, we enhance the realized state check to

Check gateway-interface when check the VPC realized state
Retry when ProviderNotReady error is detected

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