for_each_secondary_endpoint

Function for_each_secondary_endpoint 

Source
pub async fn for_each_secondary_endpoint<F, Fut>(
    client: &Client,
    namespace: &str,
    cluster_ref: &str,
    is_cluster_provider: bool,
    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 SECONDARY endpoints for a cluster.

Similar to for_each_primary_endpoint, but operates on SECONDARY instances. Useful for triggering zone transfers or other secondary-specific operations.

§Arguments

  • client - Kubernetes API client
  • namespace - Namespace to search for instances
  • cluster_ref - Cluster reference name
  • is_cluster_provider - Whether this is a cluster provider (cluster-scoped)
  • 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:

  • Failed to find secondary pods
  • Failed to load RNDC keys
  • Failed to get service endpoints
  • The operation closure returns an error for any endpoint