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/dag: Filter on Gateway.Listener.Protocol for supported types #3612

Merged
merged 6 commits into from
Apr 26, 2021

Conversation

stevesloka
Copy link
Member

Filters the Protocol on gateway listeners for only valid types (e.g. HTTP, HTTPS, TLS).

Fixes #3540

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

@stevesloka stevesloka added this to the 1.15.0 milestone Apr 22, 2021
@stevesloka stevesloka requested a review from a team as a code owner April 22, 2021 19:58
@stevesloka stevesloka requested review from danehans and skriss and removed request for a team April 22, 2021 19:58
@codecov
Copy link

codecov bot commented Apr 22, 2021

Codecov Report

Merging #3612 (9e7b4e6) into main (2982d58) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3612      +/-   ##
==========================================
+ Coverage   76.66%   76.69%   +0.02%     
==========================================
  Files         100      100              
  Lines        7066     7075       +9     
==========================================
+ Hits         5417     5426       +9     
+ Misses       1533     1532       -1     
- Partials      116      117       +1     
Impacted Files Coverage Δ
internal/dag/gatewayapi_processor.go 92.97% <100.00%> (-1.35%) ⬇️
internal/k8s/log.go 69.56% <0.00%> (+6.52%) ⬆️

Filters the Protocol on gateway listeners for only valid types (e.g. HTTP, HTTPS, TLS).

Fixes projectcontour#3540

Signed-off-by: Steve Sloka <slokas@vmware.com>
Spec: gatewayapi_v1alpha1.GatewaySpec{
Listeners: []gatewayapi_v1alpha1.Listener{{
Port: 443,
Protocol: gatewayapi_v1alpha1.HTTPProtocolType, // <--- invalid protocol, must be "HTTPS"
Copy link
Member

Choose a reason for hiding this comment

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

is this comment removable/movable to the below test case?

Copy link
Member

Choose a reason for hiding this comment

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

or maybe the test case names got mixed up? looking at the full file it looks like this test case is actually "insert basic single route, single hostname, gateway with TLS, invalid listener protocol"

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll remove the comment since now the protocol is ignored in relation to if tls is defined or not.

internal/dag/gatewayapi_processor.go Outdated Show resolved Hide resolved
Signed-off-by: Steve Sloka <slokas@vmware.com>
internal/dag/builder_test.go Outdated Show resolved Hide resolved
internal/dag/gatewayapi_processor.go Show resolved Hide resolved
Signed-off-by: Steve Sloka <slokas@vmware.com>
Signed-off-by: Steve Sloka <slokas@vmware.com>
Signed-off-by: Steve Sloka <slokas@vmware.com>
Signed-off-by: Steve Sloka <slokas@vmware.com>
Copy link
Member

@skriss skriss left a comment

Choose a reason for hiding this comment

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

LGTM pending CI.

@stevesloka stevesloka merged commit 5f1cc94 into projectcontour:main Apr 26, 2021
@stevesloka stevesloka deleted the filterListenerProtocol branch April 26, 2021 20:16
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.

Filter on Gateway.Listener.Protocol
3 participants