pingcap / tiup

A component manager for TiDB
https://tiup.io
Apache License 2.0
409 stars 304 forks source link

tiup mirror renew doesn’t update signature on timestamp.json and snapshot.json #2399

Open borissavelev opened 3 months ago

borissavelev commented 3 months ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?

I have a local TiUP repository. It looks like the default expiration time for custom components is 1 month. But, you can use the command tiup mirror renew to extend the expiration date. The issue is that this command doesn't update all JSON files, leading to problems with using the repository.

tiup mirror renew alertmanager --days 365
  1. What did you expect to see?

Correct expires in all JSON files, including timestamp and snapshot

  1. What did you see instead?
for f in *.json ; do printf '%s %s\n' $f  $(jq '.signed.expires' $f) ; done | grep 2024
snapshot.json "2024-05-03T20:48:47+03:00"
timestamp.json "2024-05-03T20:48:47+03:00"
  1. What version of TiUP are you using (tiup --version)?
    1.15.0 v1.15.0-nightly-1
    Go Version: go1.21.8
    Git Ref: master
    GitHash: 6f016925ab0d259bb07657f5ab83f2a2d7ef5656
kaaaaaaang commented 2 months ago

tiup does not support renew these json. you could renew them by 'tiup mirror publish' or 'tiup mirror modify '

borissavelev commented 2 months ago

thanks for the reply!

it doesn’t indeed. The problem with 'tiup mirror publish' or 'tiup mirror modify' is that you can't specify the expiration period; it's always 1 month (or 30d). I'm looking for an option to make it longer.