diff --git a/mirrord/kube/src/api/runtime.rs b/mirrord/kube/src/api/runtime.rs index a8a33547418..19b36afecb5 100644 --- a/mirrord/kube/src/api/runtime.rs +++ b/mirrord/kube/src/api/runtime.rs @@ -281,6 +281,12 @@ pub trait RuntimeDataProvider { ) -> impl Future>; } +/// Trait for resources that abstract a set of pods +/// defined by a label selector. +/// +/// Implementors are provided with an implementation of [`RuntimeDataProvider`]. +/// When resolving [`RuntimeData`], the set of pods is fetched and [`RuntimeData`] is extracted from +/// the first pod on the list. If the set is empty, resolution fails. pub trait RuntimeDataFromLabels { type Resource: Resource + Clone diff --git a/mirrord/operator/src/client.rs b/mirrord/operator/src/client.rs index b92b3b1ea97..9550ddfe4b2 100644 --- a/mirrord/operator/src/client.rs +++ b/mirrord/operator/src/client.rs @@ -615,6 +615,8 @@ impl OperatorApi { // `targetless` has no `RuntimeData`! if matches!(target, ResolvedTarget::Targetless(_)).not() { + // Extracting runtime data asserts that the user can see at least one pod from the + // workload/service targets. let runtime_data = target .runtime_data(self.client(), target.namespace()) .await?;