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

feat: mark programmed=false with an error when too many addresses are assigned #3713

Merged
merged 4 commits into from
Jul 5, 2024

Conversation

sanposhiho
Copy link
Contributor

What type of PR is this?

What this PR does / why we need it:

This PR changes the impl to mark programmed=false with an error when too many addresses are assigned.
The motivation here is to enhance the visibility of this error to users.

Which issue(s) this PR fixes:

Fixes #3662

@sanposhiho sanposhiho requested a review from a team as a code owner June 30, 2024 17:25
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.01%. Comparing base (51c6eb4) to head (6053799).
Report is 29 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3713      +/-   ##
==========================================
+ Coverage   68.81%   69.01%   +0.20%     
==========================================
  Files         175      176       +1     
  Lines       21525    21746     +221     
==========================================
+ Hits        14812    15009     +197     
- Misses       5636     5657      +21     
- Partials     1077     1080       +3     

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

Copy link
Contributor Author

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

followup comments

@@ -128,26 +129,45 @@ func computeGatewayAcceptedCondition(gw *gwapiv1.Gateway, accepted bool) metav1.
}
}

const (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

define messages as const to make it easier to be referred from test cases.

// computeGatewayProgrammedCondition computes the Gateway Programmed status condition.
// Programmed condition surfaces true when the Envoy Deployment status is ready.
func computeGatewayProgrammedCondition(gw *gwapiv1.Gateway, deployment *appsv1.Deployment) metav1.Condition {
func computeGatewayProgrammedCondition(gw *gwapiv1.Gateway, deployment *appsv1.Deployment) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

interface has to be changed so that it can mutate gateway, not only condition.

Copy link
Contributor

Choose a reason for hiding this comment

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

if that case lets call this updateGatewayProgrammedCondition ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That sounds better. Updated. 🙏

expect: metav1.Condition{
Status: metav1.ConditionFalse,
Reason: string(gwapiv1.GatewayReasonNoResources),
name: "not ready gateway with too many addresses",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like too many diff in TestGatewayReadyCondition though, the core change is the addition of this test case only.

Signed-off-by: Kensei Nakada <[email protected]>
Copy link
Contributor

@arkodg arkodg 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 !

@arkodg arkodg requested review from a team July 4, 2024 02:59
Copy link
Contributor

@shawnh2 shawnh2 left a comment

Choose a reason for hiding this comment

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

lgtm

@shawnh2
Copy link
Contributor

shawnh2 commented Jul 4, 2024

/retest

1 similar comment
@sanposhiho
Copy link
Contributor Author

/retest

@zirain zirain merged commit 86ebbde into envoyproxy:main Jul 5, 2024
26 checks passed
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.

Setting EnvoyService to NodePort type has a bug when total number of k8s nodes > 16
4 participants