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)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 915B399122 for ; Thu, 20 Apr 2023 14:10:09 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6DD3E2B385 for ; Thu, 20 Apr 2023 14:09:39 +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)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 20 Apr 2023 14:09:38 +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 1DA4445D5F for ; Thu, 20 Apr 2023 14:09:38 +0200 (CEST) Message-ID: <7c9cb5a9-d18b-98e5-fe89-37f51dbdf786@proxmox.com> Date: Thu, 20 Apr 2023 14:09:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 To: Dominik Csapak , Proxmox VE development discussion References: <20230419154348.4099167-1-a.lauterer@proxmox.com> <1a5b620b-13e1-3c6e-5d1c-10fac6e6d5d2@proxmox.com> Content-Language: en-US From: Aaron Lauterer In-Reply-To: <1a5b620b-13e1-3c6e-5d1c-10fac6e6d5d2@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 1.214 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 NICE_REPLY_A -2.597 Looks like a legit reply (A) 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:10:09 -0000 On 4/20/23 14:01, Dominik Csapak wrote: > 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 thanks, will do :)