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

internal/status: Update HTTPRoute status to only allow a single Type #3600

Merged
merged 2 commits into from
Apr 22, 2021

Conversation

stevesloka
Copy link
Member

Updates the HTTPRoute status processing to only allow a single "Type" to
be specified at any given time. If there are duplicate conditions for the same
type, then the messages are appended together.

Fixes #3534

Signed-off-by: Steve Sloka slokas@vmware.com

@stevesloka stevesloka added this to the 1.15.0 milestone Apr 20, 2021
@stevesloka stevesloka requested a review from a team as a code owner April 20, 2021 19:12
@stevesloka stevesloka requested review from sunjayBhatia and youngnick and removed request for a team April 20, 2021 19:12
@codecov
Copy link

codecov bot commented Apr 20, 2021

Codecov Report

Merging #3600 (3980128) into main (b155ccc) will decrease coverage by 0.02%.
The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3600      +/-   ##
==========================================
- Coverage   76.65%   76.63%   -0.03%     
==========================================
  Files         100      100              
  Lines        7039     7044       +5     
==========================================
+ Hits         5396     5398       +2     
- Misses       1527     1530       +3     
  Partials      116      116              
Impacted Files Coverage Δ
internal/status/httproutestatus.go 35.00% <55.55%> (+0.45%) ⬆️
internal/dag/gatewayapi_processor.go 94.31% <100.00%> (ø)

@stevesloka
Copy link
Member Author

integration tests are failing, not sure why, need to dig into that.

@stevesloka
Copy link
Member Author

Ok this should all be fixed up. =)

Copy link
Member

@sunjayBhatia sunjayBhatia left a comment

Choose a reason for hiding this comment

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

overall looks good, some small comments

internal/dag/status_test.go Outdated Show resolved Hide resolved
Value: "/",
},
}},
ForwardTo: []gatewayapi_v1alpha1.HTTPRouteForwardTo{{
Copy link
Member

Choose a reason for hiding this comment

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

In the case that these two rules are in the reverse order, do we expect the condition message to be Service "invalid-two" does not exist, Service "invalid-one" does not exist

Would there be value in ensuring the order of the parts of the message are sorted for comparisons between existing and potentially updated status?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I'd expect if you reverse the order the messages would be swapped.

if there was an existing condition with the same Type and something got added, it should get recreated from scratch so I'd expect the order to be consistent, unless I'm misunderstanding.

Updates the HTTPRoute status processing to only allow a single "Type" to
be specified at any given time. If there are duplicate conditions for the same
type, then the messages are appended together.

Fixes projectcontour#3534

Signed-off-by: Steve Sloka <slokas@vmware.com>
Signed-off-by: Steve Sloka <slokas@vmware.com>
Copy link
Member

@youngnick youngnick left a comment

Choose a reason for hiding this comment

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

LGTM, nice.

@stevesloka stevesloka merged commit 3e59de8 into projectcontour:main Apr 22, 2021
@stevesloka stevesloka deleted the issues/3534 branch April 22, 2021 13:39
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.

Gateway API: HTTPRoutes should have at most one Condition of a given type
3 participants