hyperbadger / nomad-pipeline

Run pipeline-style workloads in Nomad
MIT License
41 stars 2 forks source link

Pull more settings from env for nomad client #25

Closed EmilNadimanov closed 1 year ago

EmilNadimanov commented 1 year ago

Nomad Client for some users relies on Namespace and Region to correctly execute requests.

Default Config actually does set .namespace and .region to their env-var equivalents. Unfortunately in the nomad.NewClient function only the address is set to the env-var value, if it's empty. No such checks are made for other (non-crucial) fields.

EmilNadimanov commented 1 year ago

@waquidvp hi! I hope you have not abandoned this repo yet :D I don't have experience with Golang beyond the official Tour of Go, but after reading the source code, I figure these changes should do the trick. In my case the missing .namespace was the problem, resulting in the innit job getting 404 (job not found) on request due to .namespace being unset

waquidvp commented 1 year ago

Hey, @EmilNadimanov this make total sense. In my Nomad setup I wasn't using namespaces so this was never a problem. I will get this merged and released as soon as I can.

Also, I haven't abandoned this project, in fact I am actively working on new features and improvements. If there are any problems you come across, feel free to raise a bug and I can have a look at it. Or if you are feeling lucky, get a PR in.

And again, thanks for contributing!