pub struct HostNetworking {
pub host_alias: String,
pub add_host_arg: Option<String>,
pub sibling_host: String,
}Expand description
Resolved container-to-host networking for a given CLI. Built once at runtime construction and reused for every container spawn.
Fields§
§host_alias: StringDNS name a spawned container uses to reach fakecloud on the host.
host.containers.internal for podman, host.docker.internal for
docker.
add_host_arg: Option<String><alias>:<value> argument for --add-host, injected into every
container create/run. None when the runtime provides the
alias natively (podman).
sibling_host: StringAddress fakecloud uses to reach the sibling containers it just
spawned (readiness probes + advertised endpoints). 127.0.0.1
when fakecloud runs on the host; host.docker.internal when
fakecloud is itself containerized (FAKECLOUD_IN_CONTAINER=1).
Implementations§
Source§impl HostNetworking
impl HostNetworking
Sourcepub fn detect(cli: &str) -> Self
pub fn detect(cli: &str) -> Self
Resolve networking for cli, reading FAKECLOUD_IN_CONTAINER from
the process environment.
Sourcepub fn push_add_host_args(&self, argv: &mut Vec<String>)
pub fn push_add_host_args(&self, argv: &mut Vec<String>)
Convenience: append the --add-host <alias>:<value> flag pair to a
growing argv vector when this runtime needs an explicit mapping.
No-op for podman.
Trait Implementations§
Source§impl Clone for HostNetworking
impl Clone for HostNetworking
Source§fn clone(&self) -> HostNetworking
fn clone(&self) -> HostNetworking
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more