-
Notifications
You must be signed in to change notification settings - Fork 352
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
trait: Add tests for route trait and read certificate from secrets #2577
Conversation
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.
I think we can take the opportunity and make this more general than just secret
. We should use the path
concept (ie TLSCertificatePath
) that will read a generic path on the runtime integration. That path will be filled by a secret/configmap/file/volume ... by the user via --resource
option.
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.
We need to complete the e2e tests with re-encrypt and pass-through cases. That would help making the configuration coherent.
For the edge case, the configuration is independent from the Camel K runtime, but for the other cases, it may be useful to have a consistent way to inject the certificates into the runtime.
Last but not least, it'd be great that the re-encrypt case covers the use of a certificate provided by service signing certificate secrets, see https://docs.openshift.com/container-platform/4.8/security/certificates/service-serving-certificate.html#add-service-certificate_service-serving-certificate.
9609f3d
to
56e8753
Compare
@astefanutti more e2e tests were added, to support 5 cases: no tls, edge, reencrypt, reencrypt with service signing and passthrough |
It may not help in this case, because by using |
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.
I think there are still room for certain improvements. It would benefit the e2e test performance and maintainability of code.
e2e/common/traits/route_test.go
Outdated
return &svc, err | ||
} | ||
|
||
func addAnnotation(ns string, name string, annotations map[string]string) error { |
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.
Same comment as for getService
method
f37842c
to
cd7671f
Compare
There are issues running the route tests, related to openshift 3 test cluster (CI) complaining about different base domain names. I am investigating this issue. |
cd7671f
to
c9155c7
Compare
I changed the e2e test to skip TLS certificate validation for client http request when it is unable to determine the dns base domain name (from dns/cluster object). So the route tests are green, but other unrelated tests are failing due to timeouts. |
retest this please |
c9155c7
to
92a6854
Compare
There is a single test "Route reencrypt (with openshift service CA) https works" failing because the route host is not ready yet, that may occur occasionally, we may increase the timeout before the route object is ready for use, but it is my view the tests are in good shape. |
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.
I'm not sure I understand why it's necessary for users to deal with low level resource mounting and Quarkus properties. Could the user provide only the secret name and the termination type, then the trait would take care of mounting the secret and set the Quarkus properties accordingly?
It just happen that using quarkus http requires these quarkus properties for SSL setup, whatever http client the user may choose it may require a different set of parameters to setup it. For example, Netty SSL requires mounting |
it's not clear to me why the |
bc168b6
to
1be24ad
Compare
For testing I am using Openshift on IBM cloud and I noticed the operator-ingress uses a letsencrypt certificate CA to manage the serving service CA certificates, which are different than the serving certificates provided by a standard openshift 4 installation. They use different secrets to store the CA and certificate.s That said, I could not yet find a standard way to retrieve the certificate in either cloud services, to read them and set in the http client of the e2e tests. So, I disabled the https certificate verification on client side of the e2e route tests. So I ask to accept this tests as it is, and I can work on this specific certificate client side validation later on. |
bb9347c
to
a0258d4
Compare
a0258d4
to
4c9f67f
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.
Great work!
@claudio4j could you please fix the conflicts in |
4c9f67f
to
bb3be4f
Compare
* Add parameters to read TLS certificates from secrets * Add unit tests for route TLS configuration * Add e2e tests for route TLS configuration * Add example in route trait documentation
bb3be4f
to
0b239e3
Compare
@astefanutti rebase done. All checks are green. |
@claudio4j thanks! |
Fix #2574
Release Note