-
Notifications
You must be signed in to change notification settings - Fork 618
Event Transform JSONata TLS #8515
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
Event Transform JSONata TLS #8515
Conversation
|
Skipping CI for Draft Pull Request. |
| cert := &cmv1.Certificate{ | ||
| ObjectMeta: metav1.ObjectMeta{ | ||
| Name: CertificateName(name), | ||
| Name: CertificateName(obj.GetName()), |
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.
thx for these
|
/easycla |
|
/check-cla |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8515 +/- ##
==========================================
+ Coverage 52.22% 52.53% +0.30%
==========================================
Files 397 397
Lines 24354 24778 +424
==========================================
+ Hits 12719 13016 +297
- Misses 10863 10978 +115
- Partials 772 784 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
86cd0fc to
9c72a97
Compare
|
/check-cla |
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>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
9c72a97 to
69d9c5d
Compare
|
/retest-required |
| expected := jsonataDeployment(ctx, r.configWatcher, expression, transform) | ||
| func (r *Reconciler) reconcileJsonataTransformationCertificate(ctx context.Context, transform *eventing.EventTransform) (*cmapis.Certificate, error) { | ||
| if f := feature.FromContext(ctx); !f.IsStrictTransportEncryption() && !f.IsPermissiveTransportEncryption() { | ||
| return nil, r.deleteJsonataTransformationCertificate(ctx, transform) |
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.
that;s a good point for integration sink as well
| ) | ||
|
|
||
| func init() { | ||
| // TODO: Use dynamic (filtered) informer factory since cert-manager is an optional dependency: https://github.com/knative/eventing/pull/8517 |
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.
👍
| } | ||
| if !transform.Status.PropagateJsonataCertificateStatus(created.Status) { | ||
| // Wait for Certificate to become ready before continuing. | ||
| return nil, controller.NewSkipKey("") |
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.
why the skip key?
should we factor this out for some more generic reuse, e.g into the certififcates?
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.
Because the certificate is not ready and we need to wait for it to become ready to continue, so we skip and the object will get re-queued when the certificate status changes
|
|
||
| func (r *Reconciler) reconcileJsonataTransformationDeployment(ctx context.Context, expression *corev1.ConfigMap, certificate *cmapis.Certificate, transform *eventing.EventTransform) error { | ||
| withCombinedTrustBundle := false | ||
| if isPresent, _ := eventingtls.CombinedBundlePresent(r.trustBundleConfigMapLister); isPresent { |
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.
why this check here, for combined / trustBundle?
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.
This is to check if SinkBinding will inject the trust bundle volume and configure nodejs to read it for outgoing requests
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, for integration we have this, since we leverage existing API via Containersource.
thx
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.
for IntegrationSource this might be relevant, how are we reading trust bundles on the kamelet/data plane side?
| return nil | ||
| } | ||
|
|
||
| func CombinedBundlePresent(trustBundleLister corev1listers.ConfigMapLister) (bool, 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.
mind adding a little comment on top?
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.
Done
5e2a3fd to
cc9fc58
Compare
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
cc9fc58 to
1d7ccc9
Compare
matzew
left a comment
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
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: matzew, 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 |
* Event Transform JSONata TLS Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * HA and security context Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Reconcile Certificate Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Additional unit tests cases Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * EventTransform trust bundle propagation and tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix tests and address comments Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> --------- Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* Event Transform JSONata TLS Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * HA and security context Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Reconcile Certificate Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Additional unit tests cases Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * EventTransform trust bundle propagation and tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix tests and address comments Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> --------- Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* Partial implementation of certmanager for integration sink (knative#8481) * Adding cert-mananger bits Basics for Cert-manager Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Adding create cert manifest function Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Use the make cert Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Reconcile Certificate manifest and add RBAC Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Add secret filter to controller Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Look up secrets/certs for sink Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Remove old/wrong Certificate manifest and reference Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Fix controller compile Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Formatting Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * change the reconcile of cert manifest, and run it only w/ some form of TLS Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * using filtered informer Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Adding Rekt test for IntegrationSink TLS support Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * adding a bit of https port for deployment/service of the IntegrationSink Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Mounting secrets and setting quarkus env vars for TLS support Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Adding flags for different TLS levels resulting in diffeerent quarkus env vars Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Remove bad comment Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Adding label Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Update codegen Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Disable tmp. the cert manager feature Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Fixing header/year Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * More test tweaking Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Remove unused and comment out the hooks for now Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> --------- Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Run make generate-release Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Remove unused code (knative#8485) Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * IntegrationSink prefactors (knative#8486) Little refactors on IntegrationSink Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Add initial iteration of eventing-integration resources (knative#8493) * Generic code for Certificates (knative#8489) Make Certifacte factory more generic Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Jsonata Event transform e2e tests (knative#8499) * E2E tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * EventTransform Jsonata e2e tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Use eventing-integrations images and fix tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Verify response status code received by source Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Update JSONata transformations Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> --------- Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Inject integration images from ConfigMap (knative#8500) Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Run make generate-release Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Update to the correct file (knative#8507) Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * EventTransform: Inject tracing configurations (knative#8479) Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * EventTransform: add reconciler unit tests (knative#8513) * EventTransform: add reconciler unit tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Update pkg/reconciler/testing/v1alpha1/eventtransform.go Co-authored-by: Marek Schmidt <maschmid@redhat.com> --------- Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> Co-authored-by: Marek Schmidt <maschmid@redhat.com> * Enable Cert Manager (knative#8509) * Re-enable Cert Mgr Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Manual informer Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Update main Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * update controller Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Adding label on cert Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * add enqueue Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Create Cert Informer, on demand, and cancle when flag is disabled Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Update unit tests that broke during rrefactors Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> --------- Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Event Transform JSONata TLS (knative#8515) * Event Transform JSONata TLS Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * HA and security context Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Reconcile Certificate Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Additional unit tests cases Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * EventTransform trust bundle propagation and tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix tests and address comments Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> --------- Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Run make generate-release Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Add dynamic cert-manager certificates informer (knative#8517) * Add dynamic informer, part I Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Add Dynamic certificates informer for EventTransform Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Add Dynamic certificates Informer to IntegrationSink Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix error message Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> --------- Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> Co-authored-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Improve CM Cert reconcile and deletion if feature is turned off (knative#8519) refactor CM Cert reconciler and take care of delete if feature is disabled Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Remove transformations and integrations ConfigMaps (#1201) We don't use the ConfigMaps to inject the values, the operator will replace the value to the images directly. Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> Co-authored-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Run make generate-release Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Add configmaps/finalizers permissions Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Add update finalizers permissions for EventTransform reconciled resources Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Volume mounts use direct Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Fix EventTransform with TLS Sink test Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> --------- Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> Co-authored-by: David Simansky <dsimansk@redhat.com> Co-authored-by: Pierangelo Di Pilato <pierdipi@redhat.com> Co-authored-by: Marek Schmidt <maschmid@redhat.com>
Follow up to knative-extensions/eventing-integrations#73
Proposed Changes
Pre-review Checklist
Release Note
Docs