From 1268607a68229adcdd2c657de0337f68ca044183 Mon Sep 17 00:00:00 2001 From: andrussal Date: Sun, 8 Mar 2026 15:06:38 +0100 Subject: [PATCH] Align attach wording with existing-cluster mode --- .../scenario/runtime/providers/attach_provider.rs | 8 ++++---- .../compose/src/deployer/attach_provider.rs | 12 ++++++------ .../deployers/compose/src/deployer/orchestrator.rs | 12 ++++++------ .../deployers/compose/src/docker/control.rs | 2 +- .../deployers/k8s/src/deployer/attach_provider.rs | 6 +++--- .../deployers/k8s/src/deployer/orchestrator.rs | 11 ++++++----- 6 files changed, 26 insertions(+), 25 deletions(-) diff --git a/testing-framework/core/src/scenario/runtime/providers/attach_provider.rs b/testing-framework/core/src/scenario/runtime/providers/attach_provider.rs index b239193..aadb31c 100644 --- a/testing-framework/core/src/scenario/runtime/providers/attach_provider.rs +++ b/testing-framework/core/src/scenario/runtime/providers/attach_provider.rs @@ -2,7 +2,7 @@ use async_trait::async_trait; use crate::scenario::{Application, DynError, ExistingCluster}; -/// Attached node discovered from an existing external cluster source. +/// Node discovered from an existing cluster descriptor. #[derive(Clone, Debug)] pub struct AttachedNode { /// Optional stable identity hint used by runtime inventory dedup logic. @@ -14,7 +14,7 @@ pub struct AttachedNode { /// Errors returned by attach providers while discovering attached nodes. #[derive(Debug, thiserror::Error)] pub enum AttachProviderError { - #[error("attach source is not supported by this provider: {attach_source:?}")] + #[error("existing cluster descriptor is not supported by this provider: {attach_source:?}")] UnsupportedSource { attach_source: ExistingCluster }, #[error("attach discovery failed: {source}")] Discovery { @@ -23,13 +23,13 @@ pub enum AttachProviderError { }, } -/// Internal adapter interface for discovering pre-existing nodes. +/// Internal adapter interface for discovering nodes in an existing cluster. /// /// This is scaffolding-only in phase 1 and is intentionally not wired into /// deployer runtime orchestration yet. #[async_trait] pub trait AttachProvider: Send + Sync { - /// Discovers node clients for the requested attach source. + /// Discovers node clients for the requested existing cluster. async fn discover( &self, source: &ExistingCluster, diff --git a/testing-framework/deployers/compose/src/deployer/attach_provider.rs b/testing-framework/deployers/compose/src/deployer/attach_provider.rs index 8874fd1..24c16d6 100644 --- a/testing-framework/deployers/compose/src/deployer/attach_provider.rs +++ b/testing-framework/deployers/compose/src/deployer/attach_provider.rs @@ -176,12 +176,12 @@ impl ClusterWaitHandle for ComposeAttachedClusterWait } fn compose_wait_request(source: &ExistingCluster) -> Result, DynError> { - let project = source - .compose_project() - .ok_or_else(|| DynError::from("compose cluster wait requires a compose attach source"))?; - let services = source - .compose_services() - .ok_or_else(|| DynError::from("compose cluster wait requires a compose attach source"))?; + let project = source.compose_project().ok_or_else(|| { + DynError::from("compose cluster wait requires a compose existing-cluster descriptor") + })?; + let services = source.compose_services().ok_or_else(|| { + DynError::from("compose cluster wait requires a compose existing-cluster descriptor") + })?; Ok(ComposeAttachRequest { project, services }) } diff --git a/testing-framework/deployers/compose/src/deployer/orchestrator.rs b/testing-framework/deployers/compose/src/deployer/orchestrator.rs index aa4f9c1..8dca52f 100644 --- a/testing-framework/deployers/compose/src/deployer/orchestrator.rs +++ b/testing-framework/deployers/compose/src/deployer/orchestrator.rs @@ -73,9 +73,9 @@ impl DeploymentOrchestrator { if matches!(scenario.cluster_mode(), ClusterMode::ExistingCluster) { return self - .deploy_attached_only::(scenario, source_plan) + .deploy_existing_cluster::(scenario, source_plan) .await - .map(|runner| (runner, attached_metadata(scenario))); + .map(|runner| (runner, existing_cluster_metadata(scenario))); } let deployment = scenario.deployment(); @@ -138,7 +138,7 @@ impl DeploymentOrchestrator { )) } - async fn deploy_attached_only( + async fn deploy_existing_cluster( &self, scenario: &Scenario, source_plan: SourceOrchestrationPlan, @@ -218,7 +218,7 @@ impl DeploymentOrchestrator { let attach = scenario .existing_cluster() .ok_or(ComposeRunnerError::InternalInvariant { - message: "attached node control requested outside attached source mode", + message: "existing-cluster node control requested outside existing-cluster mode", })?; let node_control = ComposeAttachedNodeControl::try_from_existing_cluster(attach) .map_err(|source| ComposeRunnerError::SourceOrchestration { source })?; @@ -236,7 +236,7 @@ impl DeploymentOrchestrator { let attach = scenario .existing_cluster() .ok_or(ComposeRunnerError::InternalInvariant { - message: "compose attached cluster wait requested outside attached source mode", + message: "compose cluster wait requested outside existing-cluster mode", })?; let cluster_wait = ComposeAttachedClusterWait::::try_new(compose_runner_host(), attach) .map_err(|source| ComposeRunnerError::SourceOrchestration { source })?; @@ -366,7 +366,7 @@ impl DeploymentOrchestrator { } } -fn attached_metadata(scenario: &Scenario) -> ComposeDeploymentMetadata +fn existing_cluster_metadata(scenario: &Scenario) -> ComposeDeploymentMetadata where E: ComposeDeployEnv, Caps: Send + Sync, diff --git a/testing-framework/deployers/compose/src/docker/control.rs b/testing-framework/deployers/compose/src/docker/control.rs index 90b8a3d..799b633 100644 --- a/testing-framework/deployers/compose/src/docker/control.rs +++ b/testing-framework/deployers/compose/src/docker/control.rs @@ -155,7 +155,7 @@ impl NodeControlHandle for ComposeNodeControl { } } -/// Node control handle for compose attached mode. +/// Node control handle for compose existing-cluster mode. pub struct ComposeAttachedNodeControl { pub(crate) project_name: String, } diff --git a/testing-framework/deployers/k8s/src/deployer/attach_provider.rs b/testing-framework/deployers/k8s/src/deployer/attach_provider.rs index 43925bc..bdfa1fe 100644 --- a/testing-framework/deployers/k8s/src/deployer/attach_provider.rs +++ b/testing-framework/deployers/k8s/src/deployer/attach_provider.rs @@ -247,9 +247,9 @@ impl ClusterWaitHandle for K8sAttachedClusterWait { } fn k8s_wait_request(source: &ExistingCluster) -> Result, DynError> { - let label_selector = source - .k8s_label_selector() - .ok_or_else(|| DynError::from("k8s cluster wait requires a k8s attach source"))?; + let label_selector = source.k8s_label_selector().ok_or_else(|| { + DynError::from("k8s cluster wait requires a k8s existing-cluster descriptor") + })?; if label_selector.trim().is_empty() { return Err(K8sAttachDiscoveryError::EmptyLabelSelector.into()); diff --git a/testing-framework/deployers/k8s/src/deployer/orchestrator.rs b/testing-framework/deployers/k8s/src/deployer/orchestrator.rs index 67652be..d14e373 100644 --- a/testing-framework/deployers/k8s/src/deployer/orchestrator.rs +++ b/testing-framework/deployers/k8s/src/deployer/orchestrator.rs @@ -181,8 +181,9 @@ where let observability = resolve_observability_inputs(scenario.capabilities())?; if matches!(scenario.cluster_mode(), ClusterMode::ExistingCluster) { - let runner = deploy_attached_only::(scenario, source_plan, observability).await?; - return Ok((runner, attached_metadata(scenario))); + let runner = + deploy_existing_cluster::(scenario, source_plan, observability).await?; + return Ok((runner, existing_cluster_metadata(scenario))); } let deployment = build_k8s_deployment::(deployer, scenario, &observability).await?; @@ -213,7 +214,7 @@ where Ok((runner, metadata)) } -async fn deploy_attached_only( +async fn deploy_existing_cluster( scenario: &Scenario, source_plan: SourceOrchestrationPlan, observability: ObservabilityInputs, @@ -245,7 +246,7 @@ where Ok(context.build_runner(Some(Box::new(feed_task)))) } -fn attached_metadata(scenario: &Scenario) -> K8sDeploymentMetadata +fn existing_cluster_metadata(scenario: &Scenario) -> K8sDeploymentMetadata where E: K8sDeployEnv, Caps: Send + Sync, @@ -264,7 +265,7 @@ where let attach = scenario .existing_cluster() .ok_or_else(|| K8sRunnerError::InternalInvariant { - message: "k8s attached cluster wait requested outside attached source mode".to_owned(), + message: "k8s cluster wait requested outside existing-cluster mode".to_owned(), })?; let cluster_wait = K8sAttachedClusterWait::::try_new(client, attach) .map_err(|source| K8sRunnerError::SourceOrchestration { source })?;