Open maxramqvist opened 2 weeks ago
Another issue is that diffs doesn't work in the UI. As you can see in the screenshots, the web ui shows "No changes" - but I've made changes to a few different things in the job. Meta, Docker configuration (labels, image) and some Consul tags.
Using the "Diff against"-button results in that button changing and the url changing but nothing else. I checked the browsers dev tools aswell, no requests get sent when using that button.
Can confirm it both happens on when running Nomad in dev mode and proper production mode with a server cluster and separate clients.
Perhaps I should post a separate issue?
Yes, I'd appreciate a second issue for that one — should definitely be showing you diffs between job versions. For a minimum reproduction, could you try modifying a task group's count
value to see if that shows up in the diff?
Yep, I'll post a proper issue for that tomorrow. Can confirm no diffs are shown when just changing count.
Thanks in the meantime. Nomad really is a great product!
Thanks for saying so!
And regarding the original issue:
agent.server.job_tracked_versions
(defaults to 6), you actually get a job "jobname" version 0 not found
error, which is not what we intended. I think if it's not provided, we'll throw an error here.`So that's two upcoming changes: one to clarify in the docs that latest-version is only presumed for CLI requests, and another to throw an error when a version is not supplied to the HTTP API.
Nomad version
Nomad v1.9.1 BuildDate 2024-10-21T09:00:50Z Revision d9ec23f0c1035401e9df6c64d6ffb8bffc555a5e
With ACLs enabled and using Nomad namespaces.
Operating system and Environment details
Ubuntu 22.04, kernel 6.9.3 on x86_64
Issue
According to the docs:
If I don't supply the version number the oldest version gets tagged instead of the latest version.
Reproduction steps
Adding Version to the body tags the version intended.
curl -H "x-nomad-token: $NOMAD_TOKEN" http://localhost:4646/v1/job/test-service/versions/vActualLatest/tag\?namespace\=mynamespace -X POST -d '{"Version": 3}'
Results in:{"Name":"vActualLatest","Description":"","TaggedTime":1729537656801230518,"Index":270,"LastContact":0,"KnownLeader":false,"NextToken":""}
Results in the desired version getting tagged:{}
is accepted. No biggie really, just not obvious that its required.curl -X POST -H "x-nomad-token: $NOMAD_TOKEN" http://localhost:4646/v1/job/test-service/versions/v3/tag\?namespace\=mynamespace
results in the response:Request body is empty
. Specifying an empty JSON as request body works:curl -H "x-nomad-token: $NOMAD_TOKEN" http://localhost:4646/v1/job/test-service/versions/v3/tag\?namespace\=mynamespace -X POST -d '{}'
, response: ``{"Name":"v3","Description":"","TaggedTime":1729537150671061477,"Index":186,"LastContact":0,"KnownLeader":false,"NextToken":""}Expected Result
I could create a tag on the latest version of a job without specifying the exact version of the job, as the docs say.
Actual Result
The first version, number 0, gets tagged if I don't specify the exact version I want to tag.