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

namespaceSelector under tiggerGroups will not set --is-multi-ns=true on EventListener Pod. #1652

Closed
flatheadmill opened this issue Oct 14, 2023 · 4 comments · Fixed by #1725
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@flatheadmill
Copy link

Expected Behavior

Specifying a namespaceSelector under triggerGroups for an EventListener should create an event listener pod with with the --is-multi-ns flag set to true.

Actual Behavior

When a namespaceSelector under triggerGroups for an EventListener is specified without additionally specifying a namespaceSelector under spec the pod is created with --is-multi-ns=false.

Steps to Reproduce the Problem

With the following manifests in is-multi-ns-false.yaml...

apiVersion: v1
kind: Namespace
metadata:
    name: builderify
---
apiVersion: triggers.tekton.dev/v1beta1
kind: EventListener
metadata:
  name: github
  namespace: builderify
spec:
  triggerGroups:
  - name: push
    interceptors:
    - ref:
        name: "cel"
      params:
      - name: "filter"
        value: "header.match('X-GitHub-Event', 'push')"
    triggerSelector:
      labelSelector:
        matchLabels:
          github: push
      namespaceSelector:
        matchNames:
        - '*'

Run the following...

 $ kubectl apply -f is-multi-ns-false.yaml 
 $ kubectl -n builderify get pods -o yaml | grep is-multi-ns
      - --is-multi-ns=false
 $ kubectl delete -f is-multi-ns-false.yaml

With the following manifests in is-multi-ns-true.yaml...

apiVersion: v1
kind: Namespace
metadata:
    name: builderify
---
apiVersion: triggers.tekton.dev/v1beta1
kind: EventListener
metadata:
  name: github
  namespace: builderify
spec:
  namespaceSelector:
    matchNames:
    - will-not-match
  triggerGroups:
  - name: push
    interceptors:
    - ref:
        name: "cel"
      params:
      - name: "filter"
        value: "header.match('X-GitHub-Event', 'push')"
    triggerSelector:
      labelSelector:
        matchLabels:
          github: push
      namespaceSelector:
        matchNames:
        - '*'

Run the following...

 $ kubectl apply -f is-multi-ns-true.yaml 
 $ kubectl -n builderify get pods -o yaml | grep is-multi-ns
      - --is-multi-ns=true
 $ kubectl delete -f is-multi-ns-true.yaml 

With a namespaceSelector under spec set to match a non-existent namespace the pod is configured to inspect namespaces and the namespaceSelectors under triggerGroups works as expected. The namespaceSelector under spec will not match anything so there will be no duplicates. A temporary fix for people who encounter the same problem. (Assuming the maintainers agree it is a problem.)

Additional Info

  • Kubernetes version:

    Output of kubectl version:

Client Version: v1.28.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.27.6
  • Tekton Pipeline version:
Client version: 0.32.0
Pipeline version: v0.52.0
Triggers version: v0.25.0
Dashboard version: v0.40.1
@flatheadmill flatheadmill added the kind/bug Categorizes issue or PR as related to a bug. label Oct 14, 2023
@khrm
Copy link
Contributor

khrm commented Oct 18, 2023

/assign @khrm

@cugykw
Copy link

cugykw commented Nov 4, 2023

/cc @cugykw

@khrm
Copy link
Contributor

khrm commented Apr 5, 2024

/assign @khrm

@seternate
Copy link
Contributor

seternate commented May 2, 2024

@khrm I tried to implement a fix for this one. Let me know if anything needs to be changed: #1725

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants