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

dkron config only loads when webhook-endpoint is set #1147

Open
gsilvapt opened this issue Jun 30, 2022 · 0 comments
Open

dkron config only loads when webhook-endpoint is set #1147

gsilvapt opened this issue Jun 30, 2022 · 0 comments

Comments

@gsilvapt
Copy link

gsilvapt commented Jun 30, 2022

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:

WebhookEndpoint string `mapstructure:"webhook-endpoint" mapstructure:"webhook-url"`

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant