dkron icon indicating copy to clipboard operation
dkron copied to clipboard

dkron config only loads when webhook-endpoint is set

Open gsilvapt opened this issue 3 years ago • 0 comments

Describe the bug When setting up dkron, we were using webhook-url to update the job's results in another place. Suddenly it stopped working when we updated our fork from upstream. Looking at the code, we noticed an important change in dkron/config.go: webhook-url was being deprecated by `webhook-endpoint .

I am not entirely familiar with spf13 framework for flag parsing but the code reads like it accepts both: https://github.com/distribworks/dkron/blob/f051261f1fbbbe363750c22633444f6ecf528c61/dkron/config.go#L150

The truth of the matter is that, well, it doesn't. Only webhook-endpoint works. That had me thinking maybe it's not supposed to accept both flag and this is indeed a typo.

To Reproduce Steps to reproduce the behavior:

  1. Add webhook-url: <something> in your dkron.yml file.
  2. Run a job
  3. Notice the webhook is never called.

Expected behavior If you'd like dkron to support both flags, then this logic has to be tweaked. If you'd like dkron to only support webhook-endpoint config setting, then the latter bit of code should disappear.

If it's the latter, I can submit a PR for this change.

Screenshots N/A

** Specifications:**

  • OS: CentOS
  • Version 3.1.11

Additional context N/A

gsilvapt avatar Jun 30 '22 10:06 gsilvapt