pub async fn for_each_instance_endpoint<F, Fut>(
client: &Client,
instance_refs: &[InstanceReference],
with_rndc_key: bool,
port_name: &str,
operation: F,
) -> Result<(Option<String>, usize)>Expand description
Execute an operation on all endpoints for a list of instance references.
This is the event-driven instance-based approach that operates on instances discovered via spec.bind9InstancesFrom selectors.
§Arguments
client- Kubernetes API clientinstance_refs- List of instance references to processwith_rndc_key- Whether to load and pass RNDC keys for each instanceport_name- Port name to use for endpoints (e.g., “rndc-api”, “dns-tcp”)operation- Async closure to execute for each endpoint
§Returns
Ok((first_endpoint, total_endpoints))- First endpoint found and total count
§Errors
Returns an error if all operations fail or if critical API calls fail.