public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pdm-devel] [PATCH datacenter-manager] server: api: resources: handle template in status count
@ 2025-04-16 11:31 Dominik Csapak
  2025-04-17 15:38 ` Thomas Lamprecht
  2025-04-18  6:43 ` Dominik Csapak
  0 siblings, 2 replies; 5+ messages in thread
From: Dominik Csapak @ 2025-04-16 11:31 UTC (permalink / raw)
  To: pdm-devel

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 server/src/api/resources.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/src/api/resources.rs b/server/src/api/resources.rs
index 453d9e8..ddcee7e 100644
--- a/server/src/api/resources.rs
+++ b/server/src/api/resources.rs
@@ -191,14 +191,14 @@ pub async fn get_status(
                     _ => counts.storages.unknown += 1,
                 },
                 Resource::PveQemu(r) => match r.status.as_str() {
+                    _ if r.template => counts.qemu.template += 1,
                     "running" => counts.qemu.running += 1,
-                    // FIXME: handle templates
                     "stopped" => counts.qemu.stopped += 1,
                     _ => counts.qemu.unknown += 1,
                 },
                 Resource::PveLxc(r) => match r.status.as_str() {
+                    _ if r.template => counts.lxc.template += 1,
                     "running" => counts.lxc.running += 1,
-                    // FIXME: handle templates
                     "stopped" => counts.lxc.stopped += 1,
                     _ => counts.lxc.unknown += 1,
                 },
-- 
2.39.5



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


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

* Re: [pdm-devel] [PATCH datacenter-manager] server: api: resources: handle template in status count
  2025-04-16 11:31 [pdm-devel] [PATCH datacenter-manager] server: api: resources: handle template in status count Dominik Csapak
@ 2025-04-17 15:38 ` Thomas Lamprecht
  2025-04-18  6:12   ` Dominik Csapak
  2025-04-18  6:43 ` Dominik Csapak
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Lamprecht @ 2025-04-17 15:38 UTC (permalink / raw)
  To: Proxmox Datacenter Manager development discussion, Dominik Csapak

Seems simple enough, but the existences of the FIXME comments warrant
and actual commit message, i.e. why wasn't this done earlier already
if it's so simple? And FWIW, a short message would not hurt in any way.

Am 16.04.25 um 13:31 schrieb Dominik Csapak:
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  server/src/api/resources.rs | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/server/src/api/resources.rs b/server/src/api/resources.rs
> index 453d9e8..ddcee7e 100644
> --- a/server/src/api/resources.rs
> +++ b/server/src/api/resources.rs
> @@ -191,14 +191,14 @@ pub async fn get_status(
>                      _ => counts.storages.unknown += 1,
>                  },
>                  Resource::PveQemu(r) => match r.status.as_str() {
> +                    _ if r.template => counts.qemu.template += 1,
>                      "running" => counts.qemu.running += 1,
> -                    // FIXME: handle templates
>                      "stopped" => counts.qemu.stopped += 1,
>                      _ => counts.qemu.unknown += 1,
>                  },
>                  Resource::PveLxc(r) => match r.status.as_str() {
> +                    _ if r.template => counts.lxc.template += 1,
>                      "running" => counts.lxc.running += 1,
> -                    // FIXME: handle templates
>                      "stopped" => counts.lxc.stopped += 1,
>                      _ => counts.lxc.unknown += 1,
>                  },



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


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

* Re: [pdm-devel] [PATCH datacenter-manager] server: api: resources: handle template in status count
  2025-04-17 15:38 ` Thomas Lamprecht
@ 2025-04-18  6:12   ` Dominik Csapak
  2025-04-18  6:16     ` Thomas Lamprecht
  0 siblings, 1 reply; 5+ messages in thread
From: Dominik Csapak @ 2025-04-18  6:12 UTC (permalink / raw)
  To: Thomas Lamprecht, Proxmox Datacenter Manager development discussion

On 4/17/25 17:38, Thomas Lamprecht wrote:
> Seems simple enough, but the existences of the FIXME comments warrant
> and actual commit message, i.e. why wasn't this done earlier already
> if it's so simple? And FWIW, a short message would not hurt in any way.
> 

ah yes, sorry.

For the longest time we did not get the info about templates from the api because
the pve return description for that was missing. And after we added
that, nobody updated this code to handle the new fields.

I'll send a v2 with that explanation in the commit message

> Am 16.04.25 um 13:31 schrieb Dominik Csapak:
>> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
>> ---
>>   server/src/api/resources.rs | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/server/src/api/resources.rs b/server/src/api/resources.rs
>> index 453d9e8..ddcee7e 100644
>> --- a/server/src/api/resources.rs
>> +++ b/server/src/api/resources.rs
>> @@ -191,14 +191,14 @@ pub async fn get_status(
>>                       _ => counts.storages.unknown += 1,
>>                   },
>>                   Resource::PveQemu(r) => match r.status.as_str() {
>> +                    _ if r.template => counts.qemu.template += 1,
>>                       "running" => counts.qemu.running += 1,
>> -                    // FIXME: handle templates
>>                       "stopped" => counts.qemu.stopped += 1,
>>                       _ => counts.qemu.unknown += 1,
>>                   },
>>                   Resource::PveLxc(r) => match r.status.as_str() {
>> +                    _ if r.template => counts.lxc.template += 1,
>>                       "running" => counts.lxc.running += 1,
>> -                    // FIXME: handle templates
>>                       "stopped" => counts.lxc.stopped += 1,
>>                       _ => counts.lxc.unknown += 1,
>>                   },
> 



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


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

* Re: [pdm-devel] [PATCH datacenter-manager] server: api: resources: handle template in status count
  2025-04-18  6:12   ` Dominik Csapak
@ 2025-04-18  6:16     ` Thomas Lamprecht
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2025-04-18  6:16 UTC (permalink / raw)
  To: Dominik Csapak, Proxmox Datacenter Manager development discussion

Am 18.04.25 um 08:12 schrieb Dominik Csapak:
> For the longest time we did not get the info about templates from the api because
> the pve return description for that was missing. And after we added
> that, nobody updated this code to handle the new fields.
> 
> I'll send a v2 with that explanation in the commit message

Thanks, mentioning the respective repo & commit references would be
also appreciated then.


_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


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

* Re: [pdm-devel] [PATCH datacenter-manager] server: api: resources: handle template in status count
  2025-04-16 11:31 [pdm-devel] [PATCH datacenter-manager] server: api: resources: handle template in status count Dominik Csapak
  2025-04-17 15:38 ` Thomas Lamprecht
@ 2025-04-18  6:43 ` Dominik Csapak
  1 sibling, 0 replies; 5+ messages in thread
From: Dominik Csapak @ 2025-04-18  6:43 UTC (permalink / raw)
  To: pdm-devel

superseded by v3:
https://lore.proxmox.com/pdm-devel/20250418064250.622118-1-d.csapak@proxmox.com/


_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


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

end of thread, other threads:[~2025-04-18  6:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-16 11:31 [pdm-devel] [PATCH datacenter-manager] server: api: resources: handle template in status count Dominik Csapak
2025-04-17 15:38 ` Thomas Lamprecht
2025-04-18  6:12   ` Dominik Csapak
2025-04-18  6:16     ` Thomas Lamprecht
2025-04-18  6:43 ` Dominik Csapak

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