diff --git a/logos/examples/tests/compose_attach_node_control.rs b/logos/examples/tests/compose_attach_node_control.rs index 7b3e5fe..4f909a6 100644 --- a/logos/examples/tests/compose_attach_node_control.rs +++ b/logos/examples/tests/compose_attach_node_control.rs @@ -20,7 +20,9 @@ async fn compose_attach_mode_queries_node_api_opt_in() -> Result<()> { Err(error) => return Err(Error::new(error)), }; - let attach_source = metadata.attach_source().map_err(|err| anyhow!("{err}"))?; + let attach_source = metadata + .existing_cluster() + .map_err(|err| anyhow!("{err}"))?; let attached = ScenarioBuilder::deployment_with(|d| d.with_node_count(1)) .with_run_duration(Duration::from_secs(5)) .with_existing_cluster(attach_source) diff --git a/logos/examples/tests/k8s_attach_node_control.rs b/logos/examples/tests/k8s_attach_node_control.rs index f309eee..47bbe35 100644 --- a/logos/examples/tests/k8s_attach_node_control.rs +++ b/logos/examples/tests/k8s_attach_node_control.rs @@ -20,7 +20,9 @@ async fn k8s_attach_mode_queries_node_api_opt_in() -> Result<()> { Err(error) => return Err(Error::new(error)), }; - let attach_source = metadata.attach_source().map_err(|err| anyhow!("{err}"))?; + let attach_source = metadata + .existing_cluster() + .map_err(|err| anyhow!("{err}"))?; let attached = ScenarioBuilder::deployment_with(|d| d.with_node_count(1)) .with_run_duration(Duration::from_secs(5)) .with_existing_cluster(attach_source) diff --git a/testing-framework/deployers/compose/src/deployer/mod.rs b/testing-framework/deployers/compose/src/deployer/mod.rs index 2f809c7..fd6f44a 100644 --- a/testing-framework/deployers/compose/src/deployer/mod.rs +++ b/testing-framework/deployers/compose/src/deployer/mod.rs @@ -43,9 +43,9 @@ impl ComposeDeploymentMetadata { self.project_name.as_deref() } - /// Builds an attach source for the same compose project using deployer - /// discovery to resolve services. - pub fn attach_source(&self) -> Result { + /// Builds an existing-cluster descriptor for the same compose project + /// using deployer discovery to resolve services. + pub fn existing_cluster(&self) -> Result { let project_name = self .project_name() .ok_or(ComposeMetadataError::MissingProjectName)?; @@ -56,8 +56,8 @@ impl ComposeDeploymentMetadata { )) } - /// Builds an attach source for the same compose project. - pub fn attach_source_for_services( + /// Builds an existing-cluster descriptor for the same compose project. + pub fn existing_cluster_for_services( &self, services: Vec, ) -> Result { @@ -70,6 +70,19 @@ impl ComposeDeploymentMetadata { project_name.to_owned(), )) } + + #[doc(hidden)] + pub fn attach_source(&self) -> Result { + self.existing_cluster() + } + + #[doc(hidden)] + pub fn attach_source_for_services( + &self, + services: Vec, + ) -> Result { + self.existing_cluster_for_services(services) + } } impl Default for ComposeDeployer { diff --git a/testing-framework/deployers/k8s/src/deployer/mod.rs b/testing-framework/deployers/k8s/src/deployer/mod.rs index 43f0ff5..a43b83c 100644 --- a/testing-framework/deployers/k8s/src/deployer/mod.rs +++ b/testing-framework/deployers/k8s/src/deployer/mod.rs @@ -34,8 +34,8 @@ impl K8sDeploymentMetadata { self.label_selector.as_deref() } - /// Builds an attach source for the same k8s deployment scope. - pub fn attach_source(&self) -> Result { + /// Builds an existing-cluster descriptor for the same k8s deployment scope. + pub fn existing_cluster(&self) -> Result { let namespace = self.namespace().ok_or(K8sMetadataError::MissingNamespace)?; let label_selector = self .label_selector() @@ -46,4 +46,9 @@ impl K8sDeploymentMetadata { namespace.to_owned(), )) } + + #[doc(hidden)] + pub fn attach_source(&self) -> Result { + self.existing_cluster() + } } diff --git a/testing-framework/deployers/k8s/src/deployer/orchestrator.rs b/testing-framework/deployers/k8s/src/deployer/orchestrator.rs index 1565a40..836a892 100644 --- a/testing-framework/deployers/k8s/src/deployer/orchestrator.rs +++ b/testing-framework/deployers/k8s/src/deployer/orchestrator.rs @@ -290,7 +290,7 @@ fn managed_cluster_wait( ) -> Result>, K8sRunnerError> { let client = client_from_cluster(cluster)?; let attach_source = metadata - .attach_source() + .existing_cluster() .map_err(|source| K8sRunnerError::SourceOrchestration { source })?; Ok(Arc::new(K8sAttachedClusterWait::::new(