Skip to content
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

[release-0.25] Set DLS namespace to object namespace before resolving DLS #5903

Conversation

pierDipi
Copy link
Member

If the namespace of the DLS on the broker or trigger
is not specified we can't resolve the DLS.

Note: I'm still investigating if this regression is present in
0.26 too, so I'm starting fixing this from the known broken
branch.

Reproducer:

---
apiVersion: v1
kind: Namespace
metadata:
  labels:
    bindings.knative.dev/include: "true"
  name: broker-v1-dlq
---
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: event-display
  namespace: broker-v1-dlq
spec:
  template:
    spec:
      containers:
      - image: quay.io/openshift-knative/knative-eventing-sources-event-display:v0.13.2
---
apiVersion: messaging.knative.dev/v1
kind: Channel
metadata:
  name: dlq-channel
  namespace: broker-v1-dlq
---
apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
  name: broker
  namespace: broker-v1-dlq
spec:
  delivery:
    backoffDelay: PT1S
    backoffPolicy: linear
    deadLetterSink:
      ref:
        apiVersion: messaging.knative.dev/v1
        kind: Channel
        name: dlq-channel
    retry: 5
---
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
  name: subscription
  namespace: broker-v1-dlq
spec:
  broker: broker
  subscriber:
    ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: event-display
---
apiVersion: sources.knative.dev/v1
kind: SinkBinding
metadata:
  name: bind-heartbeat
  namespace: broker-v1-dlq
spec:
  subject:
    apiVersion: apps/v1
    kind: Deployment
    selector:
      matchLabels:
        app: heartbeat
  sink:
    ref:
      apiVersion: eventing.knative.dev/v1
      kind: Broker
      name: broker
  ceOverrides:
    extensions:
      sink: bound
---
apiVersion: eventing.knative.dev/v1beta1
kind: EventType
metadata:
  name: dev.knative.eventing.samples.heartbeat
  namespace: broker-v1-dlq
spec:
  type: dev.knative.eventing.samples.heartbeat
  source: https://knative.dev/eventing-contrib/cmd/heartbeats/#broker-v1/heartbeat
  broker: broker
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hearbeat
  namespace: broker-v1-dlq
  labels:
   app: heartbeat
   bindings.knative.dev/include: "true"
spec:
  selector:
    matchLabels:
      app: heartbeat
  template:
    metadata:
      labels:
        app: heartbeat
    spec:
      containers:
      - name: single-heartbeat
        image: quay.io/openshift-knative/knative-eventing-sources-heartbeats:v0.13.2
        args:
        - --period=1
        env:
        - name: POD_NAME
          value: heartbeat
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace

Output:

    - lastTransitionTime: "2021-11-15T08:19:19Z"
      message: channels.messaging.knative.dev "dlq-channel" not found
      reason: Unable to get the dead letter sink's URI
      status: "False"
      type: DeadLetterSinkResolved

Proposed Changes

  • Set DLS namespace to object namespace before resolving DLS

Pre-review Checklist

  • 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

Release Note

Set DLS namespace to object namespace before resolving DLS.

Docs

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Nov 15, 2021
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 15, 2021
@knative-prow-robot
Copy link
Contributor

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 15, 2021
@codecov
Copy link

codecov bot commented Nov 15, 2021

Codecov Report

❗ No coverage uploaded for pull request base (release-0.25@4b3c52f). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##             release-0.25    #5903   +/-   ##
===============================================
  Coverage                ?   82.79%           
===============================================
  Files                   ?      200           
  Lines                   ?     6267           
  Branches                ?        0           
===============================================
  Hits                    ?     5189           
  Misses                  ?      748           
  Partials                ?      330           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b3c52f...bef1ca3. Read the comment docs.

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
@pierDipi
Copy link
Member Author

/cherry-pick release-0.26

This is a problem in 0.26 too.

@knative-prow-robot
Copy link
Contributor

@pierDipi: once the present PR merges, I will cherry-pick it on top of release-0.26 in a new PR and assign it to you.

In response to this:

/cherry-pick release-0.26

This is a problem in 0.26 too.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/broker/trigger/trigger.go 88.5% 88.2% -0.3

@pierDipi
Copy link
Member Author

See #5906

@pierDipi pierDipi closed this Nov 15, 2021
@pierDipi pierDipi deleted the SRVKE-1043_Unable_to_get_the_dead_letter_sink_URI-v0.25 branch November 15, 2021 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants