From: Dominik Csapak <d.csapak@proxmox.com>
To: Proxmox Datacenter Manager development discussion
<pdm-devel@lists.proxmox.com>,
Lukas Wagner <l.wagner@proxmox.com>
Subject: Re: [pdm-devel] [PATCH proxmox-datacenter-manager v6 4/6] fake remote: make the fake_remote feature compile again
Date: Wed, 20 Aug 2025 10:26:46 +0200 [thread overview]
Message-ID: <5966fc29-a0d3-4a89-af58-724b60b94ba6@proxmox.com> (raw)
In-Reply-To: <20250814075622.51786-5-l.wagner@proxmox.com>
On 8/14/25 09:56, Lukas Wagner wrote:
> The ClientFactory trait was changed in Wolfgang's multi-client patches,
> this commit adapts the fake remote feature to the changes.
>
> Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
> Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
> Tested-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>
> Notes:
> Changes in v6:
> - add missing memhost value for ClusterResource
are you sure you wrote that to the correct patch? no 'memhost' or 'mem'
or 'host' occurs in this patch ;)
>
> No changes in v5
>
> No changes in v4
>
> No changes in v3
>
> new in v2
>
> server/src/test_support/fake_remote.rs | 29 +++++++++++++-------------
> 1 file changed, 15 insertions(+), 14 deletions(-)
>
> diff --git a/server/src/test_support/fake_remote.rs b/server/src/test_support/fake_remote.rs
> index 0161d8e6..ae0f0af1 100644
> --- a/server/src/test_support/fake_remote.rs
> +++ b/server/src/test_support/fake_remote.rs
> @@ -1,18 +1,22 @@
> -use std::{collections::HashMap, time::Duration};
> +use std::{collections::HashMap, sync::Arc, time::Duration};
>
> use anyhow::{bail, Error};
> +use serde::Deserialize;
> +
> use pdm_api_types::{remotes::Remote, Authid, ConfigDigest};
> use pdm_config::remotes::RemoteConfig;
> use proxmox_product_config::ApiLockGuard;
> use proxmox_section_config::typed::SectionConfigData;
> use pve_api_types::{
> - client::PveClient, ClusterMetrics, ClusterMetricsData, ClusterNodeIndexResponse,
> - ClusterNodeIndexResponseStatus, ClusterResource, ClusterResourceKind, ClusterResourceType,
> - ListTasks, ListTasksResponse, PveUpid, StorageContent,
> + ClusterMetrics, ClusterMetricsData, ClusterNodeIndexResponse, ClusterNodeIndexResponseStatus,
> + ClusterResource, ClusterResourceKind, ClusterResourceType, ListTasks, ListTasksResponse,
> + PveUpid, StorageContent,
> };
> -use serde::Deserialize;
>
> -use crate::{connection::ClientFactory, pbs_client::PbsClient};
> +use crate::{
> + connection::{ClientFactory, PveClient},
> + pbs_client::PbsClient,
> +};
>
> #[derive(Deserialize, Clone)]
> #[serde(rename_all = "kebab-case")]
> @@ -74,8 +78,8 @@ impl FakeRemoteConfig {
>
> #[async_trait::async_trait]
> impl ClientFactory for FakeClientFactory {
> - fn make_pve_client(&self, _remote: &Remote) -> Result<Box<dyn PveClient + Send + Sync>, Error> {
> - Ok(Box::new(FakePveClient {
> + fn make_pve_client(&self, _remote: &Remote) -> Result<Arc<PveClient>, Error> {
> + Ok(Arc::new(FakePveClient {
> nr_of_vms: self.config.vms_per_pve_remote,
> nr_of_cts: self.config.cts_per_pve_remote,
> nr_of_nodes: self.config.nodes_per_pve_remote,
> @@ -88,7 +92,7 @@ impl ClientFactory for FakeClientFactory {
> &self,
> _remote: &Remote,
> _target_endpoint: Option<&str>,
> - ) -> Result<Box<dyn PveClient + Send + Sync>, Error> {
> + ) -> Result<Arc<PveClient>, Error> {
> bail!("not implemented")
> }
>
> @@ -96,10 +100,7 @@ impl ClientFactory for FakeClientFactory {
> bail!("not implemented")
> }
>
> - async fn make_pve_client_and_login(
> - &self,
> - _remote: &Remote,
> - ) -> Result<Box<dyn PveClient + Send + Sync>, Error> {
> + async fn make_pve_client_and_login(&self, _remote: &Remote) -> Result<Arc<PveClient>, Error> {
> bail!("not implemented")
> }
>
> @@ -118,7 +119,7 @@ struct FakePveClient {
> }
>
> #[async_trait::async_trait]
> -impl PveClient for FakePveClient {
> +impl pve_api_types::client::PveClient for FakePveClient {
> async fn cluster_resources(
> &self,
> _ty: Option<ClusterResourceKind>,
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next prev parent reply other threads:[~2025-08-20 8:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-14 7:56 [pdm-devel] [PATCH proxmox-datacenter-manager v6 0/6] remote task cache fetching task / better cache backend Lukas Wagner
2025-08-14 7:56 ` [pdm-devel] [PATCH proxmox-datacenter-manager v6 1/6] remote tasks: implement improved cache for remote tasks Lukas Wagner
2025-08-19 14:24 ` Dominik Csapak
2025-08-20 7:50 ` Dominik Csapak
2025-08-14 7:56 ` [pdm-devel] [PATCH proxmox-datacenter-manager v6 2/6] remote tasks: add background task for task polling, use new task cache Lukas Wagner
2025-08-20 8:25 ` Dominik Csapak
2025-08-14 7:56 ` [pdm-devel] [PATCH proxmox-datacenter-manager v6 3/6] pdm-api-types: remote tasks: add new_from_str constructor for TaskStateType Lukas Wagner
2025-08-14 7:56 ` [pdm-devel] [PATCH proxmox-datacenter-manager v6 4/6] fake remote: make the fake_remote feature compile again Lukas Wagner
2025-08-20 8:26 ` Dominik Csapak [this message]
2025-08-20 8:27 ` Dominik Csapak
2025-08-14 7:56 ` [pdm-devel] [PATCH proxmox-datacenter-manager v6 5/6] fake remote: clippy fixes Lukas Wagner
2025-08-14 7:56 ` [pdm-devel] [PATCH proxmox-datacenter-manager v6 6/6] fixup! fake remote: make the fake_remote feature compile again Lukas Wagner
2025-08-14 7:59 ` Lukas Wagner
2025-08-20 8:30 ` [pdm-devel] [PATCH proxmox-datacenter-manager v6 0/6] remote task cache fetching task / better cache backend Dominik Csapak
2025-08-20 12:47 ` [pdm-devel] superseded: " Lukas Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5966fc29-a0d3-4a89-af58-724b60b94ba6@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=l.wagner@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox