argoproj-labs / argocd-notifications

Notifications for Argo CD
https://argocd-notifications.readthedocs.io/
Apache License 2.0
495 stars 140 forks source link

Bug: argocd-notifications neither send email, nor set annotation #130

Open alex1989hu opened 3 years ago

alex1989hu commented 3 years ago

I commented on the PR https://github.com/argoproj-labs/argocd-notifications/pull/129#issuecomment-732787069:

I don't know will your PR fix or not, but the notification is not working after #116

Unfortunately, #129 did not fix it. Also, the new annotation from #129 is not set.

So jumping back to state before #116 or v0.7.0 makes argocd-notifications work.

Version: I have deployed the recently version if the image after/before https://github.com/argoproj-labs/argocd-notifications/pull/129

Logs:

time="2020-12-01T10:28:36Z" level=info msg="Start processing" app=argocd/dex time="2020-12-01T10:28:36Z" level=info msg="Processing completed" app=argocd/dex time="2020-12-01T10:28:36Z" level=info msg="Start processing" app=argocd/dex time="2020-12-01T10:28:36Z" level=info msg="Processing completed" app=argocd/dex

$ kubectl -n argocd get applications.argoproj.io dex -o jsonpath='{.metadata.annotations}' 
{
  "argocd.argoproj.io/sync-wave":"-1",
  "kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"argoproj.io/v1alpha1\",\"kind\":\"Application\",\"metadata\":{\"annotations\":{\"argocd.argoproj.io/sync-wave\":\"-1\"},\"finalizers\":[\"resources-finalizer.argocd.argoproj.io\"],\"labels\":{\"app.kubernetes.io/instance\":\"cluster-components\"},\"name\":\"dex\",\"namespace\":\"argocd\"},\"spec\":{\"destination\":{\"namespace\":\"kube-system\",\"server\":\"https://kubernetes.default.svc\"},\"project\":\"av-devops\",\"source\":{\"path\":\"prod-cluster/cluster-components/dex\",\"repoURL\":\"https://<redacted>\",\"targetRevision\":\"HEAD\"},\"syncPolicy\":{\"automated\":{\"prune\":true,\"selfHeal\":true}}}}\n",
  "recipients.argocd-notifications.argoproj.io":"email:my@foobarmail.com"
}

Configuration:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- github.com/argoproj-labs/argocd-notifications/manifests/controller?ref=master

patchesStrategicMerge:
- overlays/argocd-notifications-cm.yaml
- overlays/argocd-notifications-secret.yaml

namespace: argocd

images:
- name: argoprojlabs/argocd-notifications
  digest: "sha256:ef39a2dca216eb01334f30ee69476d63d4d02b9974c4b23292ccc679cacb2993"

ConfigMap:

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-notifications-cm
data:
  config.yaml: |
    context:
      argocdUrl: "https://gitops.foo.bar"
    subscriptions:
      - recipients:
        - email:my@foobarmail.com
      - recipients:
        - email:my@foobarmail.com
        trigger: on-sync-succeeded
    templates:
      []
    triggers:
      - name: on-sync-succeeded
        enabled: true
      - name: on-sync-failed
        enabled: true
      - name: on-sync-status-unknown
        enabled: true
      - name: on-health-degraded
        enabled: true
mayzhang2000 commented 3 years ago

Hi @alex1989hu, wonder if https://github.com/argoproj-labs/argocd-notifications/pull/132 fixes this issue you reported.

alex1989hu commented 3 years ago

Hello @mayzhang2000, I am afraid it did not.

Image used: docker.io/argoprojlabs/argocd-notifications@sha256:cfaf4d1c6da8ddd06d82707af2c02beae0b987606bb8eceda00dbb30b4957c59

I see the same logs and behaviour what I reported.

ryota-sakamoto commented 3 years ago

Hi @alex1989hu The latest version is v1.1.1 now, then maybe this issue is fixed on latest version. If you have already used it, would you share reproduce or not, please?