public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH storage v4 0/4] pbs: fix #5008: Check if datastore and namespace is valid on add- and update hooks
@ 2023-11-27 11:39 Philipp Hufnagl
  2023-11-27 11:39 ` [pve-devel] [PATCH storage v4 1/4] pbs: Move pbs_api_connect earlyer in the code Philipp Hufnagl
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Philipp Hufnagl @ 2023-11-27 11:39 UTC (permalink / raw)
  To: pve-devel

This adds a check if the datastore and the namespace is valid when a
user attempts to add a new PBS datastore.

Since the namespace only can be checked after the datastore is
validated, the datastore will be checked as well, regardless that it
will be done later in the superclass anyway.

The functionallity to check namespaces is added with this commit. For
checking the datastore, existing code that has previously been
refactored will be reused

Since the server address has was not included on for the on_update_hook,
I had to slightly modify src/PVE/API2/Storage/Config.pm. I checked and
are pretty sure that this modification does not break anything, however
a second look would be appreciated!

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
---

Changes since v3:
 * Modify src/PVE/API2/Storage/Config.pm to add server address

Changes since v2:
 * Typos
 * reuse connecton on one more place previously fortotten
 * simplify syntax

Changes since v1:
 * do not add any overhead to activate_storage calls
 * splits code from activate_storage so parts of it can be reused
 * adds new methods to check namespaces
 * calls checks on add/update hooks

Philipp Hufnagl (4):
  pbs: Move pbs_api_connect earlyer in the code
  pbs: Make it possible to reuse PBS connection for datastore API call
  pbs: Extraxt check_datastore_exists from activate_storage
  pbs: fix #5008: Check if datastore and namespace is valid on add- and
    update hooks

 src/PVE/API2/Storage/Config.pm |   4 +-
 src/PVE/Storage/PBSPlugin.pm   | 122 +++++++++++++++++++++++----------
 2 files changed, 86 insertions(+), 40 deletions(-)

-- 
2.39.2





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-02-19  8:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-27 11:39 [pve-devel] [PATCH storage v4 0/4] pbs: fix #5008: Check if datastore and namespace is valid on add- and update hooks Philipp Hufnagl
2023-11-27 11:39 ` [pve-devel] [PATCH storage v4 1/4] pbs: Move pbs_api_connect earlyer in the code Philipp Hufnagl
2024-02-16 15:56   ` Fiona Ebner
2023-11-27 11:39 ` [pve-devel] [PATCH storage v4 2/4] pbs: Make it possible to reuse PBS connection for datastore API call Philipp Hufnagl
2024-02-16 15:56   ` Fiona Ebner
2023-11-27 11:40 ` [pve-devel] [PATCH storage v4 3/4] pbs: Extraxt check_datastore_exists from activate_storage Philipp Hufnagl
2024-02-16 15:56   ` Fiona Ebner
2024-02-19  8:34   ` Fiona Ebner
2023-11-27 11:40 ` [pve-devel] [PATCH storage v4 4/4] pbs: fix #5008: Check if datastore and namespace is valid on add- and update hooks Philipp Hufnagl
2024-02-16 15:56   ` Fiona Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal