public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ui: CephInstallWizard: avoid using localhost on first configuration
Date: Wed, 19 Apr 2023 17:43:48 +0200	[thread overview]
Message-ID: <20230419154348.4099167-1-a.lauterer@proxmox.com> (raw)

If a user is accessing the Ceph install wizard via Datacenter -> Ceph
and gets to the configuration part, the variable 'nodename' will be
'localhost'. This means, that the first MON and MGR would be using
'localhost' as their ID.
Therefore fall back to 'Proxmox.NodeName' in that case to create the API
POST request with the actual hostname, resulting in MON and MGR IDs as
we would expect them.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
 www/manager6/ceph/CephInstallWizard.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/manager6/ceph/CephInstallWizard.js b/www/manager6/ceph/CephInstallWizard.js
index 47efe182..0340e396 100644
--- a/www/manager6/ceph/CephInstallWizard.js
+++ b/www/manager6/ceph/CephInstallWizard.js
@@ -404,7 +404,7 @@ Ext.define('PVE.ceph.CephInstallWizard', {
 		    xtype: 'displayfield',
 		    fieldLabel: gettext('Monitor node'),
 		    cbind: {
-			value: '{nodename}',
+			value: get => get('nodename') === 'localhost' ? Proxmox.NodeName : get('nodename'),
 		    },
 		},
 		{
@@ -461,7 +461,7 @@ Ext.define('PVE.ceph.CephInstallWizard', {
 		    var wizard = me.up('window');
 		    var kv = wizard.getValues();
 		    delete kv.delete;
-		    var nodename = me.nodename;
+		    let nodename = me.nodename === 'localhost' ? Proxmox.NodeName : me.nodename;
 		    delete kv.nodename;
 		    Proxmox.Utils.API2Request({
 			url: `/nodes/${nodename}/ceph/init`,
-- 
2.30.2





             reply	other threads:[~2023-04-19 15:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19 15:43 Aaron Lauterer [this message]
2023-04-20 12:01 ` Dominik Csapak
2023-04-20 12:09   ` Aaron Lauterer

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=20230419154348.4099167-1-a.lauterer@proxmox.com \
    --to=a.lauterer@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