Eventing TLS: support K_CA_CERTS in adapter/v2#6848
Eventing TLS: support K_CA_CERTS in adapter/v2#6848knative-prow[bot] merged 5 commits intoknative:mainfrom
K_CA_CERTS in adapter/v2#6848Conversation
K_CA_CERTS in adapter/v2K_CA_CERTS in adapter/v2
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #6848 +/- ##
==========================================
- Coverage 80.40% 79.96% -0.44%
==========================================
Files 236 237 +1
Lines 12243 12354 +111
==========================================
+ Hits 9844 9879 +35
- Misses 1907 1981 +74
- Partials 492 494 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
81d5079 to
e85b76a
Compare
|
You have successfully added a new CodeQL configuration |
e85b76a to
d4871fe
Compare
| module knative.dev/eventing | ||
|
|
||
| go 1.18 | ||
| go 1.19 |
There was a problem hiding this comment.
This is needed to be able to use x509.CertPool.Clone()
d4871fe to
284cf32
Compare
This patch adds support for the `K_CA_CERTS` environment variable for the source adapter library. This will enable the APIServerSource data plane to work with the Eventing TLS feature. Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
284cf32 to
b592562
Compare
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
K_CA_CERTS in adapter/v2K_CA_CERTS in adapter/v2
| // DefaultMinTLSVersion is the default minimum TLS version for servers and clients. | ||
| DefaultMinTLSVersion = tls.VersionTLS12 |
There was a problem hiding this comment.
I was wondering if we should go with 1.3?
| if err != nil { | ||
| return | ||
| } |
pkg/adapter/v2/cloudevents.go
Outdated
| "github.com/cloudevents/sdk-go/v2/event" | ||
| "github.com/cloudevents/sdk-go/v2/protocol" | ||
| "github.com/cloudevents/sdk-go/v2/protocol/http" | ||
| cehttp "github.com/cloudevents/sdk-go/v2/protocol/http" |
There was a problem hiding this comment.
Nit: Is this a duplicate import? Can just use the import above
| UpdateFunc: func(_, newObj interface{}) { | ||
| store(newObj) | ||
| }, | ||
| DeleteFunc: nil, |
There was a problem hiding this comment.
Should we clear the store on a delete? I can't think of a valid reason for a user to delete the Secret but the intent is likely to stop the usage of the cert when that happens.
There was a problem hiding this comment.
I was thinking about that, however, if the secret is deleted by mistake that would cause an outage or maybe the cert management is migrated to a different tool (like Cert-Manager first and Vault after), there might be a need to delete and recreate the secret without downtime and that is hard if we stop serving the certs.
pkg/eventingtls/eventingtls.go
Outdated
|
|
||
| // Clone the pool before appending other certs or returning since we don't want to add user | ||
| // provided CA certs for different resources to the system pool or to any other "global" pool. | ||
| p = p.Clone() |
There was a problem hiding this comment.
I think it's safe to assume it'll already be a copy. From SystemCertPool :
// SystemCertPool returns a copy of the system cert pool.
// Any mutations to the returned pool are not written to disk and do not affect
// any other pool returned by SystemCertPool.
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
|
/test upgrade-tests |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gab-satchi, pierDipi The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This patch adds support for the `K_CA_CERTS` environment variable for the source adapter library. This will enable the APIServerSource data plane and other sources leveraging adapter/v2 to work with the Eventing TLS feature. Fixes: knative#6847 --------- Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
This patch adds support for the
K_CA_CERTSenvironment variable for the source adapter library.This will enable the APIServerSource data plane and other sources leveraging adapter/v2 to work with the Eventing TLS feature.
Fixes: #6847