Better OpenPGP keys handling for signing the repository packages #3840
Labels
area/release-eng
Issues or PRs related to the Release Engineering subproject
kind/bug
Categorizes issue or PR as related to a bug.
needs-priority
sig/release
Categorizes an issue or PR as relevant to SIG Release.
I also ran into #3818 but on Fedora 40. The additional issue here is that updating
gpgkey
in/etc/yum.repos.d/kubernetes.repo
isn't enough here as the Package manager (dnf
) has already downloaded the key and, at least in my case, will not try to re-fetch it (even if I disable the repo, rundnf clean all
, and enable it again). I didn't have such issues with other repos and the problem here seems to be that only the expiration date of the key was extended instead of rotating the entire key. I'm not adnf
expert but I think most repos are switching to new keys instead of extending the experiation date. AFAIK it should also be possible to fetch/import multiple keys from a single URL so that should help with supporting older and newer packages (in this case only relevant when using an olderbaseurl
with a newergpgkey
URL).What happened:
I updated the repository:
And I can fetch the current version of the key from the
gpgkey
URL:But updating still fails:
Workarounds:
I can use the following manual workaround to remove the key so that
dnf
will have to import it again:There should be other workarounds available but this is the easiest one I came up with as there doesn't seem to be a good
dnf
command for it yet.What you expected to happen:
dnf update
will prompt to (re)import/update the key. This doesn't seem possible so the repo key should be rotated entirely instead of only extending the expiration date.How to reproduce it (as minimally and precisely as possible):
Install from an older repository with the expired key and then try to update again.
Version 1.27 seems to be the most recent version that offers the old key:
I can provide the exact commands if necessary but the basic steps are the following:
rpm -qa | grep 9a296436 | xargs rpm --erase
/etc/yum.repos.d/kubernetes.repo
back to version 1.27 (or an older version)kubectl
) from the old repo. You might have to disablegpgcheck
. Interestingly the expired key erros seem to be ignored when downgrading via:dnf downgrade kubectl
/etc/yum.repos.d/kubernetes.repo
back to the most recent version (currently 1.31)dnf upgrade kubectl
-> it will fail due to the expired keyAnything else we need to know?:
Environment:
Fedora 40 but it should apply to any
yum
/dnf
based system (it might work better with the futurednf5
though - I didn't look at that).The text was updated successfully, but these errors were encountered: