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

Plugin configuration with environment variable not updated #86

Closed
gregoryboue opened this issue Jul 1, 2020 · 3 comments
Closed

Plugin configuration with environment variable not updated #86

gregoryboue opened this issue Jul 1, 2020 · 3 comments
Assignees
Labels
kind/bug Bug related issue

Comments

@gregoryboue
Copy link

Describe the bug

I have jenkins with datadog plugin.
My jenkins instance is dockerized on kubernetes cluster and deployed by chart helm.
I configure the following env var of my container :

DATADOG_JENKINS_PLUGIN_REPORT_WITH : DSD
DATADOG_JENKINS_PLUGIN_TARGET_HOST : ip of my kubernetes node, dynamically resolved
DATADOG_JENKINS_PLUGIN_TARGET_PORT : 8125

If i deploy a fresh jenkins without plugin configuration, the configuration is ok, i can see it via jenkins administration UI.
If i redeploy my jenkins and change the value of DATADOG_JENKINS_PLUGIN_TARGET_HOST , the configuration is not updated.

And another thing, if i configure the first time manually on admin panel UI and then i set environments and restart the container, the configuration on the UI is not updated with the environment values.

To Reproduce
Steps to reproduce the behavior:

  1. Deploy jenkins from scratch with datadog plugin on docker with env (DATADOG_JENKINS_PLUGIN_REPORT_WITH...)
  2. Go to the admin datadog panel and check the configuration is ok
  3. Change the value of the env (DATADOG_JENKINS_PLUGIN_TARGET_HOST) and redeploy the container
  4. Go to the admin datadog panel and see the configuration of target host has not been updated

Expected behavior

The jenkins datadog plugin configuration is updated with correct value.
Maybe the behaviour is normal but in that case, the plugin documentation is not clear about that : https://docs.datadoghq.com/integrations/jenkins/

Environment and Versions

jenkins 2.176.3 with datadog plugin 1.1.2 dockerised and hosted on kubernetes (aks cluster)

@gregoryboue gregoryboue added the kind/bug Bug related issue label Jul 1, 2020
@FlorianVeaux FlorianVeaux self-assigned this Jul 2, 2020
@FlorianVeaux
Copy link
Contributor

Hey @gregoryboue
That behavior is not expected, environment variables should take precedence over the local configuration. I'll try to reproduce but I assume that if you delete the org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration.xml in the jenkins root dir before starting jenkins you should see the environment variables being used correctly again, correct?

Seems that it can be a small bug in the configuration loading logic, thanks for reporting 👍

@FlorianVeaux
Copy link
Contributor

I was able to reproduce and it was indeed an issue with the local configuration taking precedence over environment variables. I have merged a PR to fix this, we'll release a new version of the jenkins plugin soon with that change 👍

@gregoryboue
Copy link
Author

@FlorianVeaux Great, thanks you !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bug related issue
Projects
None yet
Development

No branches or pull requests

2 participants