tristanpemble / nix-nomad

HashiCorp Nomad job definitions in Nix
https://tristanpemble.github.io/nix-nomad/
MIT License
66 stars 6 forks source link

Incorrect transformation of VolumeRequest #1

Closed justinrubek closed 1 year ago

justinrubek commented 1 year ago

summary

job.<name>.group.<name>.volume attrs are transformed to JSON as a list. The final output ends up looking something like:

 "Volumes": [
  {                                                                                                                                                              
    "AttachmentMode": "file-system",
    "Name": "name",
    "ReadOnly": false,
    "Source": "name",
    ...
  },
   ...
],

However Nomad doesn't expect this to be a list but rather indexed by the volume's names:

"Volumes": {
        "name": {
          "Name": "name",
          "ReadOnly": false,
          "Source": "name",
          ...
        },
        ...
},

what I've tried

tristanpemble commented 1 year ago

apologies for the indecipherable Go code, it needs some serious love 😰 .

thanks for reporting this! I'm surprised we hadn't run into it yet. I merged a fix in #4, though I haven't tested it. let me know how that works for you.

justinrubek commented 1 year ago

Thank you! The newest version is working now. I'd been running it with the nix patched manually and my jobs look identical after switching back