Support TLS in Trigger and Channel reconciler#6988
Support TLS in Trigger and Channel reconciler#6988knative-prow[bot] merged 17 commits intoknative:mainfrom
Conversation
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>
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>
This will reduce and, at the same time, fix the direct access to DeadLetterSinkURI field which is not correct in the TLS case. Such wrong direct access assumes a certain structure of the DeliveryStatus type increasing coupling between components. Moving forward we can use: - NewDeliveryStatusFromAddressable - NewDestinationFromDeliveryStatus that encapsulate the common pattern of: - creating DeliveryStatus from an Addressable returned by the Resolver - creating a Destination from a DeliveryStatus (for reconcilers that wiring other resources) Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
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>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #6988 +/- ##
==========================================
- Coverage 79.61% 79.51% -0.11%
==========================================
Files 246 246
Lines 12991 13070 +79
==========================================
+ Hits 10343 10392 +49
- Misses 2131 2159 +28
- Partials 517 519 +2
☔ View full report in Codecov by Sentry. |
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
|
/test upgrade-tests |
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
|
/test unit-tests |
| got := ets.GetTopLevelCondition().Status | ||
| if test.wantConditionStatus != got { | ||
| t.Errorf("unexpected readiness: want %v, got %v", test.wantConditionStatus, got) | ||
| t.Errorf("unexpected readiness: want %v, got %v\n%+v", test.wantConditionStatus, got, ets) |
| func (imcs *InMemoryChannelStatus) MarkDeadLetterSinkResolvedSucceeded(deadLetterSinkURI eventingduck.DeliveryStatus) { | ||
| imcs.DeliveryStatus = deadLetterSinkURI |
There was a problem hiding this comment.
| func (imcs *InMemoryChannelStatus) MarkDeadLetterSinkResolvedSucceeded(deadLetterSinkURI eventingduck.DeliveryStatus) { | |
| imcs.DeliveryStatus = deadLetterSinkURI | |
| func (imcs *InMemoryChannelStatus) MarkDeadLetterSinkResolvedSucceeded(deadLetterSink eventingduck.DeliveryStatus) { | |
| imcs.DeliveryStatus = deadLetterSink |
|
|
||
| logging.FromContext(ctx).Debugw("Resolved deadLetterSink", zap.String("deadLetterSinkURI", deadLetterSinkURI.String())) | ||
| subscription.Status.PhysicalSubscription.DeadLetterSinkURI = deadLetterSinkURI | ||
| logging.FromContext(ctx).Debugw("Resolved deadLetterSink", zap.String("deadLetterSinkURI", deadLetterSinkAddr.URL.String())) |
There was a problem hiding this comment.
nit: WDYT about logging the whole DLS object (including the ca certs)? Just to have this information and it's on debug level anyhow...
pkg/reconciler/testing/v1/channel.go
Outdated
| func WithChannelStatusDLSURI(dlsURI eventingduckv1.DeliveryStatus) ChannelOption { | ||
| return func(c *eventingv1.Channel) { | ||
| c.Status.MarkDeadLetterSinkResolvedSucceeded(dlsURI) |
There was a problem hiding this comment.
| func WithChannelStatusDLSURI(dlsURI eventingduckv1.DeliveryStatus) ChannelOption { | |
| return func(c *eventingv1.Channel) { | |
| c.Status.MarkDeadLetterSinkResolvedSucceeded(dlsURI) | |
| func WithChannelStatusDLSURI(dls eventingduckv1.DeliveryStatus) ChannelOption { | |
| return func(c *eventingv1.Channel) { | |
| c.Status.MarkDeadLetterSinkResolvedSucceeded(dls) |
| } | ||
|
|
||
| func WithInMemoryChannelStatusDLSURI(dlsURI *apis.URL) InMemoryChannelOption { | ||
| func WithInMemoryChannelStatusDLS(dlsURI *duckv1.Addressable) InMemoryChannelOption { |
There was a problem hiding this comment.
| func WithInMemoryChannelStatusDLS(dlsURI *duckv1.Addressable) InMemoryChannelOption { | |
| func WithInMemoryChannelStatusDLS(dls *duckv1.Addressable) InMemoryChannelOption { |
| if dlsURI == nil { | ||
| imc.Status.MarkDeadLetterSinkNotConfigured() | ||
| return | ||
| } | ||
| imc.Status.MarkDeadLetterSinkResolvedSucceeded(eventingv1.NewDeliveryStatusFromAddressable(dlsURI)) |
There was a problem hiding this comment.
| if dlsURI == nil { | |
| imc.Status.MarkDeadLetterSinkNotConfigured() | |
| return | |
| } | |
| imc.Status.MarkDeadLetterSinkResolvedSucceeded(eventingv1.NewDeliveryStatusFromAddressable(dlsURI)) | |
| if dls == nil { | |
| imc.Status.MarkDeadLetterSinkNotConfigured() | |
| return | |
| } | |
| imc.Status.MarkDeadLetterSinkResolvedSucceeded(eventingv1.NewDeliveryStatusFromAddressable(dls)) |
| } | ||
|
|
||
| func WithSubscriptionDeadLetterSinkURI(uri *apis.URL) SubscriptionOption { | ||
| func WithSubscriptionDeadLetterSinkURI(uri *duckv1.Addressable) SubscriptionOption { |
There was a problem hiding this comment.
Shouldn't we rename the function (and its parameters), as we don't take an URI anymore?
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
|
/test unit-tests |
creydr
left a comment
There was a problem hiding this comment.
Looks good so far.
/lgtm
Putting it on hold, to give others a bit time to review too. Feel free to unhold when you're fine
/hold
|
/lgtm |
|
/unhold |
This is looking at making the control plane wiring and resolving for the triggers Eventing TLS aware. To support Eventing TLS in trigger reconciler, we need to make sure that the underlying channel is properly propagating the Status and that the subscription URI is set to the https endpoint when the TLS feature is enabled (permissive or strict) Individual commits might contain more details on the why of certain changes. <!-- Please include the 'why' behind your changes if no issue exists --> ## Proposed Changes <!-- Please categorize your changes: - 🎁 Add new feature - 🐛 Fix bug - 🧹 Update or clean up current behavior - 🗑️ Remove feature or internal logic --> - Support TLS in Trigger reconciler - Set CA certs fields for channel, subscription, broker and trigger resources related to subscriber, reply and dead letter sink ### Pre-review Checklist <!-- If these boxes are not checked, you will be asked to complete these requirements or explain why they do not apply to your PR. --> - [ ] **At least 80% unit test coverage** - [ ] **E2E tests** for any new behavior - [ ] **Docs PR** for any user-facing impact - [ ] **Spec PR** for any new API feature - [ ] **Conformance test** for any change to the spec <!-- 📖 If this change has user-visible impact, link to an issue or PR in https://github.com/knative/docs. --> --------- Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
This is looking at making the control plane wiring and resolving for the
triggers Eventing TLS aware.
To support Eventing TLS in trigger reconciler, we need to make sure that
the underlying channel is properly propagating the Status and that the
subscription URI is set to the https endpoint when the TLS feature is
enabled (permissive or strict)
Individual commits might contain more details on the why of certain
changes.
Proposed Changes
Pre-review Checklist