async fn nodeport_hosts(
    client: &stackable_operator::client::Client,
    svc: &Service,
    port_name: &str,
) -> Result<impl IntoIterator<Item = (String, u16)>, Error> {
    let svc_port = find_named_svc_port(svc, port_name).context(NoServicePortSnafu { port_name })?;
    let node_port = svc_port.node_port.context(NoNodePortSnafu { port_name })?;
    let endpoints = client
        .get::<Endpoints>(
            svc.metadata.name.as_deref().context(NoNameSnafu)?,
            svc.metadata.namespace.as_deref(),
        )
        .await
        .with_context(|_| FindEndpointsSnafu {
            svc: ObjectRef::from_obj(svc),
        })?;
    let nodes = endpoints
        .subsets
        .into_iter()
        .flatten()
        .flat_map(|subset| subset.addresses)
        .flatten()
        .flat_map(|addr| addr.node_name);
    let addrs = nodes
        .map(|node| Ok((node, node_port.try_into().context(InvalidNodePortSnafu)?)))
        .collect::<Result<BTreeSet<_>, _>>()?;
    Ok(addrs)
}
/// Lists all nodes currently hosting Pods participating in the [`Service`]
Lists all nodes currently hosting Pods participating in the [`Service`]
Lists all nodes currently hosting Pods participating in the [ ` Service ` ]
async fn nodeport_hosts(
    client: &stackable_operator::client::Client,
    svc: &Service,
    port_name: &str,
) -> Result<impl IntoIterator<Item = (String, u16)>, Error> {
    let svc_port = find_named_svc_port(svc, port_name).context(NoServicePortSnafu { port_name })?;
    let node_port = svc_port.node_port.context(NoNodePortSnafu { port_name })?;
    let endpoints = client
        .get::<Endpoints>(
            svc.metadata.name.as_deref().context(NoNameSnafu)?,
            svc.metadata.namespace.as_deref(),
        )
        .await
        .with_context(|_| FindEndpointsSnafu {
            svc: ObjectRef::from_obj(svc),
        })?;
    let nodes = endpoints
        .subsets
        .into_iter()
        .flatten()
        .flat_map(|subset| subset.addresses)
        .flatten()
        .flat_map(|addr| addr.node_name);
    let addrs = nodes
        .map(|node| Ok((node, node_port.try_into().context(InvalidNodePortSnafu)?)))
        .collect::<Result<BTreeSet<_>, _>>()?;
    Ok(addrs)
}
async fn nodeport_hosts ( client : & stackable_operator :: client :: Client , svc : & Service , port_name : & str , ) -> Result < impl IntoIterator < Item = ( String , u16 ) > , Error > { let svc_port = find_named_svc_port ( svc , port_name ) . context ( NoServicePortSnafu { port_name } ) ? ; let node_port = svc_port . node_port . context ( NoNodePortSnafu { port_name } ) ? ; let endpoints = client . get :: < Endpoints > ( svc . metadata . name . as_deref ( ) . context ( NoNameSnafu ) ? , svc . metadata . namespace . as_deref ( ) , ) . await . with_context ( | _ | FindEndpointsSnafu { svc : ObjectRef :: from_obj ( svc ) , } ) ? ; let nodes = endpoints . subsets . into_iter ( ) . flatten ( ) . flat_map ( | subset | subset . addresses ) . flatten ( ) . flat_map ( | addr | addr . node_name ) ; let addrs = nodes . map ( | node | Ok ( ( node , node_port . try_into ( ) . context ( InvalidNodePortSnafu ) ? ) ) ) . collect :: < Result < BTreeSet < _ > , _ > > ( ) ? ; Ok ( addrs ) }
Lists all nodes currently hosting Pods participating in the [`Service`]
Lists all nodes currently hosting Pods participating in the [ ` Service ` ]
client
&stackable_operator::client::Client
svc
&Service
port_name
&str
client
&stackable_operator::client::Client
svc
&Service
port_name
&str