Skip to main content

Module k3d

Module k3d 

Source
Expand description

Port of internal/cluster/k3d/driver.go and internal/cluster/k3d/ports.go: a super::Driver implementation using k3d as the backend.

This is the second highest-churn driver file in the Go codebase (51 commits per VCS hotspot analysis, the highest of all), so its tests are ported with extra care for edge cases in tests/k3d_driver.rs and tests/k3d_ports.rs.

Executor injection. Following the pattern established by external::Driver and colima::Driver (see their module doc comments), this driver takes its Arc<dyn CommandRunner + Send + Sync> at construction rather than through an ambient context. Driver::new wires in the real xianyun_executor::exec::Client so existing callers (driver::auto) need no change; Driver::with_runner is the test-facing constructor.

docker.Backend. The Go constructor also takes an injected docker.Backend and panics if it’s nil, but nothing in driver.go or ports.go ever calls a method on it – grepping the Go source for d.docker or .docker. turns up nothing beyond the field assignment in NewDriver. xianyun-backends::docker is also still a stub crate (see PORT_NOTES.md), so this port omits the parameter entirely rather than carry a genuinely dead field forward.

Structs§

Driver
Port of k3d.Driver.
K3dCluster
Port of k3d.k3dCluster, the JSON shape of k3d cluster list -o json.
K3dNode
Port of k3d.k3dNode.
K3dNodeIp
Port of k3d.k3dNodeIP.
K3dNodeState
Port of k3d.k3dNodeState.
PortMapping
Port of k3d.portMapping: a single k3d cluster create -p spec, parsed once when it enters the driver and passed around in that form.

Constants§

DRIVER_NAME

Functions§

build_cluster_create_args
Port of (*k3d.Driver).buildClusterCreateArgs.
check_port_conflicts
Port of (*k3d.Driver).checkPortConflicts.
host_ip
Port of k3d.hostIP.
is_k3d_available
Port of (*k3d.Driver).isK3dAvailable.
merge_port_mappings
Port of k3d.mergePortMappings.
node_ip
Port of k3d.nodeIP.
node_version
Port of k3d.nodeVersion.
parse_port_mapping
Port of k3d.parsePortMapping.
parse_port_mappings
Port of k3d.parsePortMappings.
probe_address
Port of k3d.probeAddress (the seam Driver.portInUse is stubbed by tests): dials address over TCP and reports whether a listener answered.
verify_config
Port of (*k3d.Driver).verifyConfig.
warn_deprecated_disable_args
Port of k3d.warnDeprecatedDisableArgs.