Documentation
¶
Overview ¶
Package dockerbridge creates Testcontainers bridges whose allocated subnet can also accept endpoints restored to their original IP on older Engines.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(ctx context.Context) (*testcontainers.DockerNetwork, error)
New first lets Docker choose an unused IPv4 subnet from its configured address pools, then recreates an empty bridge with that subnet explicitly configured. This permits reconnecting a Ceph endpoint at its advertised IP on Engines which require an explicit subnet for static endpoint addresses. Both temporary and final networks retain Testcontainers labels and Ryuk lifecycle handling.
Allocations of one process run one at a time. Only Docker's pool-overlap error, from a bridge another process created meanwhile, is retried, at most four allocations and within ctx. Failure cleanup uses its own bounded context. A non-nil network returned with an error remains owned by the caller and must be removed; inspection, removal or client-close failures never discard that ownership.
func NewFamily ¶ added in v0.2.0
func NewFamily(ctx context.Context, family Family) (*testcontainers.DockerNetwork, error)
NewFamily is New for the given family. A DualStack bridge keeps both allocated subnets explicitly, so endpoints can be restored at both addresses. An Engine without an IPv6 address pool fails the allocation.
func RestoreEndpoint ¶ added in v0.4.0
func RestoreEndpoint(original *dockernetwork.EndpointSettings) *dockernetwork.EndpointSettings
RestoreEndpoint copies the advertised addresses and requested aliases for reconnection.