public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Maximiliano Sandoval <m.sandoval@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager] ceph: pool edit: set target ratio to 0 when the value is unset
Date: Wed, 6 Mar 2024 16:08:46 +0100	[thread overview]
Message-ID: <ec1fb33f-5810-4a52-a1da-17656539b9df@proxmox.com> (raw)
In-Reply-To: <20240306141458.472837-1-m.sandoval@proxmox.com>

Am 06.03.24 um 15:14 schrieb Maximiliano Sandoval:
> If the pool has a target_size_ratio set it might be desirable to unset
> its value, e.g. if set by mistake on .mgr.
> 
> Currently unsetting the value won't do anything in the web UI. With this
> patch it is set to zero, which the API correctly understands and unsets
> it.
> 
> one can verify the value set using
> 
>     $ ceph osd pool get <POOL_NAME> target_size_ratio
> 
> after setting the valut to 0 through the API it will output
> 
>     Error ENOENT: option 'target_size_ratio' is not set on pool 'cephfs-test_data'
> 
> Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
> ---
>  www/manager6/ceph/Pool.js | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/www/manager6/ceph/Pool.js b/www/manager6/ceph/Pool.js
> index c61d4f71..224f3cea 100644
> --- a/www/manager6/ceph/Pool.js
> +++ b/www/manager6/ceph/Pool.js
> @@ -226,7 +226,11 @@ Ext.define('PVE.CephPoolInputPanel', {
>      onGetValues: function(values) {
>  	Object.keys(values || {}).forEach(function(name) {
>  	    if (values[name] === '') {
> -		delete values[name];
> +		if (name === 'target_size_ratio') {
> +		    values[name] = 0;
> +		} else {
> +		    delete values[name];
> +		}
>  	    }
>  	});
>  

It might be cleaner to just use
emptyValue: 0,
in the field declaration like is already done for the "Target Size"
field. And the same issue is also present for the "Min. # of PGs" field,
right?




  reply	other threads:[~2024-03-06 15:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 14:14 Maximiliano Sandoval
2024-03-06 15:08 ` Fiona Ebner [this message]
2024-03-06 15:17   ` Maximiliano Sandoval
2024-03-06 15:38     ` Fiona Ebner

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=ec1fb33f-5810-4a52-a1da-17656539b9df@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=m.sandoval@proxmox.com \
    --cc=pve-devel@lists.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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal