Open
Description
Platform I'm building on:
x86_64
What I expected to happen:
updata
to report correct max version available in the tuf repo. (In my case it is supposed to be 1.32.0
)
What actually happened:
updata
reported wrong value. (In my case it showed 1.18.0
)
How to reproduce the problem:
- Download the tuf manifest using
tuftool
tuftool download \
--metadata-url "https://updates.bottlerocket.aws/2020-07-07/aws-k8s-1.29/x86_64/" \
--targets-url "https://updates.bottlerocket.aws/targets" \
--root ./default.root.json \
--target-name manifest.json \
./aws-k8s-1.29/x86_64/tuf_in
- Call
updata -- remove-update
updata -- remove-update ./aws-k8s-1.29/x86_64/tuf_in/manifest.json \
--arch x86_64 \
--version 1.30.0 \
--variant aws-k8s-1.29
20:08:47 [INFO] Update x86_64-aws-k8s-1.29-1.30.0 removed. Current maximum version: 1.18.0 <== Wrong version
Sample manifest.json
{
"updates": [
{
"variant": "aws-k8s-1.29",
"arch": "x86_64",
"version": "1.18.0",
"max_version": "1.32.0",
...
},
....
{
"variant": "aws-k8s-1.29",
"arch": "x86_64",
"version": "1.30.0",
"max_version": "1.32.0",
...
},
{
"variant": "aws-k8s-1.29",
"arch": "x86_64",
"version": "1.31.0",
"max_version": "1.32.0",
...
},
{
"variant": "aws-k8s-1.29",
"arch": "x86_64",
"version": "1.32.0",
"max_version": "1.32.0",
...
}
],
"migrations": {
...
}
The max_version
in the updates field is showing correct data. But the code is referencing the version
field of the first item of the updates, which is why the max version is not correctly captured. The fix could be sort the manifest and get the latest version from the manifest version, or we can simply use the max_version
field.
Metadata
Metadata
Assignees
Labels
No labels