jenkinsci / nomad-plugin

Nomad cloud plugin for Jenkins
https://plugins.jenkins.io/nomad/
MIT License
56 stars 41 forks source link

fix: remove job using namespace #139

Closed jfroche closed 2 years ago

jfroche commented 2 years ago

Jobs created in other namespace than default are not removed correctly when worker is stopped.

Provide the namespace to the nomad api when removing a Job/stopping a worker.

jdelee commented 2 years ago

We've encountered this as well, and a related problem with nomad regions, where the job template can cause an agent to be run in a non-default region, but the request to destroy the agent does not specify the region and fails. Do you think this PR could be extended to handle region as well?

jfroche commented 2 years ago

We've encountered this as well, and a related problem with nomad regions, where the job template can cause an agent to be run in a non-default region, but the request to destroy the agent does not specify the region and fails. Do you think this PR could be extended to handle region as well?

I have added the region to the DELETE when it is not global/default region. The change doesn't handle multi region, not sure it is an actual use case for anyone. Can you check if it works for you ? Builded plugin is here: https://ci.jenkins.io/job/Plugins/job/nomad-plugin/job/master/110/artifact/org/jenkins-ci/plugins/nomad/0.9.3-rc181.db_953b_d0c0de/nomad-0.9.3-rc181.db_953b_d0c0de.hpi

multani commented 2 years ago

I'll release it as part of 0.9.3, but https://repo.jenkins-ci.org is down at the moment.