-
Notifications
You must be signed in to change notification settings - Fork 690
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: Implement TLSRoute mode:terminate #3801
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3801 +/- ##
==========================================
- Coverage 75.81% 75.78% -0.03%
==========================================
Files 107 107
Lines 7340 7344 +4
==========================================
+ Hits 5565 5566 +1
- Misses 1654 1656 +2
- Partials 121 122 +1
|
internal/dag/gatewayapi_processor.go
Outdated
@@ -112,6 +112,14 @@ func (p *GatewayAPIProcessor) Run(dag *DAG, source *KubernetesCache) { | |||
} | |||
} | |||
} | |||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this case now means a TLSRoute with no TLS field set defaults to terminate, though terminate without a secret doesn't really work? so can this just be an error now if you don't set TLS at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/shrug The spec says that "Terminate" is the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this intended to be the code for if the mode is nil? rather than the whole TLS block is nil?
sounds like the listener should be rejected if the TLS field is not set: https://github.com/kubernetes-sigs/gateway-api/blob/17a98f6f5aaa1e7fa607c1fc974efeb915b3337c/apis/v1alpha2/gateway_types.go#L184-L197
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essentially it is since the cert validation then fails on L118. Part of the problem with our unit tests is that we don't have the kubebuilder defaults applied. So we can create a test that doesn't specify the cert, but would get the mode applied by the api server and wouldn't pass the unit test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I rereead the spec and at the top level it does say "This field is required if the Protocol field is “HTTPS” or “TLS” and ignored otherwise.", so that make sense. I've updated.
436f5dc
to
1570bae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one tiny nit, looking through tests next.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more small comment on the tests, otherwise looks good. Some of the tests are pretty tough to review but I skimmed and it looks reasonable/reasonable coverage.
3aba04d
to
860a144
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no further comments, LGTM pending CI.
This one needs a rebase now that the E2E changes have gone in |
Implements support for GatewayAPI TLSRoute mode: terminate which terminates TLS at the Gateway. Updates projectcontour#3440 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>
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>
Signed-off-by: Steve Sloka <slokas@vmware.com>
0383177
to
9dee885
Compare
all rebased @skriss @sunjayBhatia, please take a look! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
}, | ||
want: listeners(), | ||
}, | ||
"TLSRoute with TLS.Mode=Terminate is invalid when TLS is not defined": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
"TLSRoute with TLS.Mode=Terminate is invalid when TLS is not defined": { | |
"TLSRoute with TLS.Mode=Terminate is invalid when TLS certificate reference is not defined": { |
gonna merge, can fix the nit separately |
Updates projectcontour#3801. Signed-off-by: Steve Kriss <krisss@vmware.com>
Updates #3801. Signed-off-by: Steve Kriss <krisss@vmware.com>
Implements support for GatewayAPI TLSRoute mode: terminate which terminates TLS
at the Gateway.
Updates #3440
Signed-off-by: Steve Sloka slokas@vmware.com