Argo-cd: SyncFail Resource Hooks not working

Created on 14 Aug 2019  路  2Comments  路  Source: argoproj/argo-cd

Describe the bug
Hey guys, i'm having trouble configuring Resource Hooks with type SyncFail, in the argo-app i get this error in the events:
https://slack-files.com/T7A4Z4285-FLMJT4JCB-497fbfeb40

Also you can see that argo don't recognize it as a resource hook in this screenshot it just look like a job that need to be deployed:

image

Now the application is stuck and I can't re-sync it because it says there is another sync process running. I don't want to force delete anything because last time i did it i had to completely re-install argocd to get rid of the stale app. which is another problem but i will try to ask about it in the argo slack first. i'm adding the hook yaml:
apiVersion: batch/v1
kind: Job
metadata:
name: slack-notify-fail
annotations:
argocd.argoproj.io/hook: SyncFail
argocd.argoproj.io/hook-delete-policy: HookSucceeded
spec:
template:
spec:
restartPolicy: Never
containers:
- name: slack-notify
image: technosophos/slack-notify:latest
env:
- name: "SLACK_WEBHOOK"
value: "https://hooks.slack.com/services/XX/XX"
- name: "SLACK_ICON"
value: "https://argoproj.github.io/argo-cd/assets/logo.png"
- name: "SLACK_CHANNEL"
value: "XX"
- name: "SLACK_MESSAGE"
value: "XX"
- name: "SLACK_USERNAME"
value: "Argo-CD-Prod"
backoffLimit: 0

To Reproduce

  1. install an application with syncfail resource hook
  2. fail the deployment with invalid value
  3. syncfail resource hook won't run.

Expected behavior
After a fail-sync i expect the syncfail resource hook to run

argocd: v1.0.1+5fe1447.dirty
  BuildDate: 2019-05-28T17:28:05Z
  GitCommit: 5fe1447b722716649143c63f9fc054886d5b111c
  GitTreeState: dirty
  GoVersion: go1.11.4
  Compiler: gc
  Platform: darwin/amd64
argocd-server: v1.1.2+567fcc3.dirty
  BuildDate: 2019-07-30T17:47:02Z
  GitCommit: 567fcc33140ec93051fdf8d0af7ea404deb64f20
  GitTreeState: dirty
  GoVersion: go1.11.4
  Compiler: gc
  Platform: linux/amd64
  Ksonnet Version: 0.13.1
bug

All 2 comments

SyncFail is available in v1.2 (see https://github.com/argoproj/argo-cd/issues/815), but docs should really state this.

@simster7 ;) do you want to own?

@alexec Absolutely, I鈥檒l update the docs.

Was this page helpful?
0 / 5 - 0 ratings