-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version tag HTTP API doesn't tag latest version (docs+api inaccurate) #24266
Comments
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. 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 |
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:
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.
The text was updated successfully, but these errors were encountered: