feat(labs): add the labd provisioner with clone pool, time to live and limits
This commit is contained in:
1 parent
9fdaa62b9b
commit
9385b2ddd4
53 files changed
+14675
-6
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package pool
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/netip"
|
||||
"time"
|
||||
)
|
||||
|
||||
// TCPProber reports a node as reachable when its management port accepts a
|
||||
// TCP connection from the host side of the management bridge.
|
||||
type TCPProber struct {
|
||||
Timeout time.Duration
|
||||
}
|
||||
|
||||
// Probe opens and closes one connection.
|
||||
func (p TCPProber) Probe(ctx context.Context, address netip.AddrPort) error {
|
||||
dialer := net.Dialer{Timeout: p.Timeout}
|
||||
connection, err := dialer.DialContext(ctx, "tcp", address.String())
|
||||
if err != nil {
|
||||
return fmt.Errorf("TCPProber.Probe - dial: %w", err)
|
||||
}
|
||||
_ = connection.Close() // Only the accepted connection matters.
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user