for_each_instance_endpoint

Function for_each_instance_endpoint 

Source
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)>
where F: Fn(String, String, Option<RndcKeyData>) -> Fut, Fut: Future<Output = Result<()>>,
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 client
  • instance_refs - List of instance references to process
  • with_rndc_key - Whether to load and pass RNDC keys for each instance
  • port_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.