From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com, s.hrdlicka@proxmox.com
Subject: Re: [pve-devel] [PATCH pve-storage 1/2] fix #2822: add lvm, lvmthin & zfs storage on all cluster nodes
Date: Tue, 7 Jun 2022 14:54:09 +0200 [thread overview]
Message-ID: <618f0831-0c07-7cfc-8465-a723c1bda70c@proxmox.com> (raw)
In-Reply-To: <20220524144532.2698959-2-s.hrdlicka@proxmox.com>
Am 24.05.22 um 16:45 schrieb Stefan Hrdlicka:
> this enables forwarding of request to the correct node if a node is set
>
> Signed-off-by: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
> ---
> PVE/API2/Storage/Config.pm | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/PVE/API2/Storage/Config.pm b/PVE/API2/Storage/Config.pm
> index 6bd770e..82b73ca 100755
> --- a/PVE/API2/Storage/Config.pm
> +++ b/PVE/API2/Storage/Config.pm
> @@ -146,6 +146,13 @@ __PACKAGE__->register_method ({
> protected => 1,
> path => '',
> method => 'POST',
> + proxyto_callback => sub {
> + my ($rpcenv, $proxyto, $uri_param) = @_;
> + my $node = delete $uri_param->{node};
Messing with the uri params here is hacky. It destroys the consistency
between the API schema and what the API call actually handles.
It's not really required to proxy the call to a specific node. The only
downside is that we don't do an early storage access check if the
storage is not enabled for the current node.
> + $node = "localhost" if !$node;
> +
> + return $node;
> + },
> description => "Create a new storage.",
> permissions => {
> check => ['perm', '/storage', ['Datastore.Allocate']],
next prev parent reply other threads:[~2022-06-07 12:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 14:45 [pve-devel] [PATCH storage, manager 0/2] " Stefan Hrdlicka
2022-05-24 14:45 ` [pve-devel] [PATCH pve-storage 1/2] " Stefan Hrdlicka
2022-06-07 12:54 ` Fabian Ebner [this message]
2022-05-24 14:45 ` [pve-devel] [PATCH pve-manager 2/2] " Stefan Hrdlicka
2022-06-07 12:54 ` Fabian Ebner
2022-05-24 14:45 ` [pve-devel] [PATCH QQQ] fix #2822: enable node storage scanning for LVM, LVMThin & ZFS Stefan Hrdlicka
2022-05-24 14:58 ` Stefan Hrdlicka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=618f0831-0c07-7cfc-8465-a723c1bda70c@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=s.hrdlicka@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox