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)>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 clientnamespace- Namespace to search for instancescluster_ref- Cluster reference nameis_cluster_provider- Whether this is a cluster provider (cluster-scoped)with_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:
- Failed to find secondary pods
- Failed to load RNDC keys
- Failed to get service endpoints
- The operation closure returns an error for any endpoint