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

Notification in one namespace watches ressources in other namespaces #18

Open
tiej-dr opened this issue May 18, 2020 · 0 comments
Open
Labels
help wanted Extra attention is needed

Comments

@tiej-dr
Copy link

tiej-dr commented May 18, 2020

Describe the bug
Notification controller checks ressources in all namespaces - and not only the namespace where notification is applied.

To Reproduce

  1. Have two apps in two different namespaces "foo" and "bar".
  2. Apply a notification to namespace "foo"

kubectl apply -f example/foo-notifier.yaml -n foo

apiVersion: argoproj.io/v1alpha1
kind: Notification
metadata:
  name: "foo-notifier"
  namespace: foo
spec:
  Namespace: foo
  monitorResource:
    Resource: pods
    Version: v1
  rules:
  - allConditions:
    - jsonPath: metadata/name
      operator: ne
      value: badName
    events:
        -
          message: |
            Test notification from namespace: {{ .metadata.namespace }}
          notificationLevel: info
          notifierNames:
            - slack
    name: "test-notification"
    initialDelaySec: 1
    throttleMinutes: 10
  notifiers:
  - name: slack
    slack:
      channel: placeholder
      hookUrlSecret:
        key: hookURL
        name: webhook-server-secret

If initialDelaySec > 0 - a warning in kube-notifier-controller-0 is logged and no message is send

kubectl logs -f  kube-notifier-controller-0

time="2020-05-18T07:19:47Z" level=warning msg="Error occured getting resource. pods \"bar-sjshv\" not found"

If initialDelaySec = 0 - the notification is send :
"Test notification from namespace: bar"

Expected behavior
The controller would only watch ressources in the namespace where notification is applied. In the above example, ressources in namespace foo, but not bar

@tiej-dr tiej-dr changed the title Notification in one namespace watches for ressources in other namespaces Notification in one namespace watches ressources in other namespaces May 18, 2020
@sarabala1979 sarabala1979 added the help wanted Extra attention is needed label Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants