]> git.proxmox.com Git - proxmox-offline-mirror.git/commit
helper: improve handling of multiple keys when activating them
authorStefan Sterz <s.sterz@proxmox.com>
Wed, 29 Nov 2023 14:51:15 +0000 (15:51 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 1 Dec 2023 15:10:53 +0000 (16:10 +0100)
commite8fded3311397d6bceaa38ef4e1a78c2cd3700d5
tree47c148774579caafac735c16aa36ac876016a6b6
parentbf022cac4013d970a54dcde102f532a293f77a9b
helper: improve handling of multiple keys when activating them

this commit fixes a behavior where pom would applied any subscription
key that matched the provided product. it did not check whether the
server id of the activated subscription matched the current system.
this commit fixes that and only allows applying subscriptions for the
current system.

it also adds a couple of ux improvements:

- the `offline-key` sub-command now does not require the `--product`
  parameter anymore. if there are multiple keys with different
  products for the same server we will try to activate them all. the
  assumption is that the user added all keys intentionally (e.g. a
  combo pbs+pve system) and would like to activate them all at once.
  since this only makes the api more permissive this shouldn't be a
  breaking change.
- if the `offline-key` sub-command encounters multiple subscription
  keys with the same product and server id, it only activates the one
  with the due date furthest in the future. this makes sense in a
  scenario where a user simply adds new subscription keys to their
  key medium without removing older ones (perhaps older subscriptions
  haven't even expired just yet).
- the interactive `setup` sub-command now only offers keys that have a
  matching server id. it also orders them in such a way that the top
  most key for a given product has the next due date furthest in the
  future.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
src/bin/proxmox-offline-mirror-helper.rs