jenkinsci / nomad-plugin

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

Start of a fix for Nomad 0.5 #13

Closed far-blue closed 7 years ago

far-blue commented 7 years ago

Nomad 0.5 moves the diskMb resource parameter out into a group-level 'ephemeral_disk' object with size, migrate and sticky attributes. Unfortunately, it also then rejects job submissions using the old resource diskMb key.

The fix is to replace the diskMb attribute in the resource block with a group-level ephemeral_disk structure. I don’t know java and don’t understand the gson library enough to know how it turns the object var names into json keys so the EphemeralDisk object prob. has the wrong json label but I believe this PR is almost right.

I also don't know how to compile jenkins plugins and test them so this PR is untested but hopefully someone can point out the errors for me!

This relates to issue #11

pawbur commented 7 years ago

Hi @far-blue,

I've fixed some mistakes in your code and committed them here: https://github.com/pawbur/nomad-plugin/commit/ac91f9bf241ea0f9b95e658edd8d8f55250cabfa

You can update your pull request or I can create a new one.

I've tested this in my lab installation and seems to work fine.

far-blue commented 7 years ago

@pawbur I'm happy for you to create a new PR - esp. if you've been able to test it :) From your tests are you saying that the ephemeral_disk structure just magically worked correctly in the json output?

pawbur commented 7 years ago

Hi @far-blue,

Just created https://github.com/jenkinsci/nomad-plugin/pull/14.

Yes, it just magically worked :)

jippi commented 7 years ago

Closing as a different PR has been merged in to fix this issue