From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id C26F099115 for ; Thu, 20 Apr 2023 14:02:05 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A02B12B189 for ; Thu, 20 Apr 2023 14:01:35 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 20 Apr 2023 14:01:34 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id EDFB545D4A; Thu, 20 Apr 2023 14:01:33 +0200 (CEST) Message-ID: <1a5b620b-13e1-3c6e-5d1c-10fac6e6d5d2@proxmox.com> Date: Thu, 20 Apr 2023 14:01:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox VE development discussion , Aaron Lauterer References: <20230419154348.4099167-1-a.lauterer@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20230419154348.4099167-1-a.lauterer@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.015 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] [PATCH manager] ui: CephInstallWizard: avoid using localhost on first configuration X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Apr 2023 12:02:05 -0000 On 4/19/23 17:43, Aaron Lauterer wrote: > 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 > --- > 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`, i'd do that in PVE.Utils.monitor_ceph_installed since that's the point where we introduce the localhost in the first place and is used for all uses of the install wizard