[pve-devel] [PATCH manager] ui: CephInstallWizard: avoid using localhost on first configuration
Aaron Lauterer
a.lauterer at proxmox.com
Thu Apr 20 14:09:36 CEST 2023
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 <a.lauterer at 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`,
>
> 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 :)
More information about the pve-devel
mailing list