Skip to content

Commit

Permalink
Fix DeadLetterSink on Trigger status
Browse files Browse the repository at this point in the history
Mistakenly hadn't added it to the CRD, so it was just getting dropped by
the apiserver. Luckily this means we shouldn't have any backwards
compatibility issues :).
  • Loading branch information
Ben Moss committed Aug 18, 2021
1 parent c183833 commit 16b7086
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions config/core/resources/trigger.yaml
Expand Up @@ -158,6 +158,9 @@ spec:
type:
description: 'Type of condition.'
type: string
deadLetterSinkUri:
description: DeadLetterSinkURI is the resolved URI of the dead letter sink for this Trigger.
type: string
observedGeneration:
description: ObservedGeneration is the 'Generation' of the Service that was last processed by the controller.
type: integer
Expand Down
4 changes: 2 additions & 2 deletions docs/eventing-api.md
Expand Up @@ -1889,7 +1889,7 @@ knative.dev/pkg/apis.URL
</tr>
<tr>
<td>
<code>deadLetterUri</code><br/>
<code>deadLetterSinkUri</code><br/>
<em>
<a href="https://pkg.go.dev/knative.dev/pkg/apis#URL">
knative.dev/pkg/apis.URL
Expand All @@ -1898,7 +1898,7 @@ knative.dev/pkg/apis.URL
</td>
<td>
<em>(Optional)</em>
<p>DeadLetterURI is the resolved URI of the dead letter sink for this Trigger.</p>
<p>DeadLetterSinkURI is the resolved URI of the dead letter sink for this Trigger.</p>
</td>
</tr>
</tbody>
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/eventing/v1/trigger_types.go
Expand Up @@ -120,9 +120,9 @@ type TriggerStatus struct {
// +optional
SubscriberURI *apis.URL `json:"subscriberUri,omitempty"`

// DeadLetterURI is the resolved URI of the dead letter sink for this Trigger.
// DeadLetterSinkURI is the resolved URI of the dead letter sink for this Trigger.
// +optional
DeadLetterURI *apis.URL `json:"deadLetterUri,omitempty"`
DeadLetterSinkURI *apis.URL `json:"deadLetterSinkUri,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/eventing/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/reconciler/broker/trigger/trigger.go
Expand Up @@ -159,10 +159,10 @@ func (r *Reconciler) resolveDeadLetterSink(ctx context.Context, b *eventingv1.Br
if err != nil {
logging.FromContext(ctx).Errorw("Unable to get the dead letter sink's URI", zap.Error(err))
t.Status.MarkDeadLetterSinkResolvedFailed("Unable to get the dead letter sink's URI", "%v", err)
t.Status.DeadLetterURI = nil
t.Status.DeadLetterSinkURI = nil
return err
}
t.Status.DeadLetterURI = dlqURI
t.Status.DeadLetterSinkURI = dlqURI
t.Status.MarkDeadLetterSinkResolvedSucceeded()
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/testing/v1/trigger.go
Expand Up @@ -192,7 +192,7 @@ func WithTriggerStatusSubscriberURI(uri string) TriggerOption {
func WithTriggerStatusDeadLetterSinkURI(uri string) TriggerOption {
return func(t *v1.Trigger) {
u, _ := apis.ParseURL(uri)
t.Status.DeadLetterURI = u
t.Status.DeadLetterSinkURI = u
}
}

Expand Down

0 comments on commit 16b7086

Please sign in to comment.