public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] ui: CephInstallWizard: avoid using localhost on first configuration
@ 2023-04-19 15:43 Aaron Lauterer
  2023-04-20 12:01 ` Dominik Csapak
  0 siblings, 1 reply; 3+ messages in thread
From: Aaron Lauterer @ 2023-04-19 15:43 UTC (permalink / raw)
  To: pve-devel

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH manager] ui: CephInstallWizard: avoid using localhost on first configuration
  2023-04-19 15:43 [pve-devel] [PATCH manager] ui: CephInstallWizard: avoid using localhost on first configuration Aaron Lauterer
@ 2023-04-20 12:01 ` Dominik Csapak
  2023-04-20 12:09   ` Aaron Lauterer
  0 siblings, 1 reply; 3+ messages in thread
From: Dominik Csapak @ 2023-04-20 12:01 UTC (permalink / raw)
  To: Proxmox VE development discussion, Aaron Lauterer

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@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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH manager] ui: CephInstallWizard: avoid using localhost on first configuration
  2023-04-20 12:01 ` Dominik Csapak
@ 2023-04-20 12:09   ` Aaron Lauterer
  0 siblings, 0 replies; 3+ messages in thread
From: Aaron Lauterer @ 2023-04-20 12:09 UTC (permalink / raw)
  To: Dominik Csapak, Proxmox VE development discussion



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@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 :)




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-20 12:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-19 15:43 [pve-devel] [PATCH manager] ui: CephInstallWizard: avoid using localhost on first configuration Aaron Lauterer
2023-04-20 12:01 ` Dominik Csapak
2023-04-20 12:09   ` Aaron Lauterer

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